diff --git a/app/models/certificate.rb b/app/models/certificate.rb new file mode 100644 index 0000000..0489195 --- /dev/null +++ b/app/models/certificate.rb @@ -0,0 +1,2 @@ +class Certificate < ActiveRecord::Base +end diff --git a/db/migrate/20160419083600_create_certificates.rb b/db/migrate/20160419083600_create_certificates.rb new file mode 100644 index 0000000..c39e6d8 --- /dev/null +++ b/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 diff --git a/db/migrate/20160419084655_add_active_to_certificates.rb b/db/migrate/20160419084655_add_active_to_certificates.rb new file mode 100644 index 0000000..6d9256b --- /dev/null +++ b/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 diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..4195dcd --- /dev/null +++ b/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 diff --git a/test/fixtures/certificates.yml b/test/fixtures/certificates.yml new file mode 100644 index 0000000..47d65c3 --- /dev/null +++ b/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 diff --git a/test/models/certificate_test.rb b/test/models/certificate_test.rb new file mode 100644 index 0000000..2294b8f --- /dev/null +++ b/test/models/certificate_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CertificateTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end