Browse Source

Add certificates model

master
Georg Hopp 10 years ago
parent
commit
49a94c3807
  1. 2
      app/models/certificate.rb
  2. 10
      db/migrate/20160419083600_create_certificates.rb
  3. 5
      db/migrate/20160419084655_add_active_to_certificates.rb
  4. 24
      db/schema.rb
  5. 9
      test/fixtures/certificates.yml
  6. 7
      test/models/certificate_test.rb

2
app/models/certificate.rb

@ -0,0 +1,2 @@
class Certificate < ActiveRecord::Base
end

10
db/migrate/20160419083600_create_certificates.rb

@ -0,0 +1,10 @@
class CreateCertificates < ActiveRecord::Migration
def change
create_table :certificates do |t|
t.string :key
t.string :cert
t.timestamps null: false
end
end
end

5
db/migrate/20160419084655_add_active_to_certificates.rb

@ -0,0 +1,5 @@
class AddActiveToCertificates < ActiveRecord::Migration
def change
add_column :certificates, :active, :boolean
end
end

24
db/schema.rb

@ -0,0 +1,24 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160419084655) do
create_table "certificates", force: :cascade do |t|
t.string "key"
t.string "cert"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "active"
end
end

9
test/fixtures/certificates.yml

@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
key: MyString
cert: MyString
two:
key: MyString
cert: MyString

7
test/models/certificate_test.rb

@ -0,0 +1,7 @@
require 'test_helper'
class CertificateTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
Loading…
Cancel
Save