Commit 49a94c380738e05437f9c810d8e6772fa1c7e3f5

Authored by Georg Hopp
1 parent 2a432dc6

Add certificates model

  1 +class Certificate < ActiveRecord::Base
  2 +end
... ...
  1 +class CreateCertificates < ActiveRecord::Migration
  2 + def change
  3 + create_table :certificates do |t|
  4 + t.string :key
  5 + t.string :cert
  6 +
  7 + t.timestamps null: false
  8 + end
  9 + end
  10 +end
... ...
  1 +class AddActiveToCertificates < ActiveRecord::Migration
  2 + def change
  3 + add_column :certificates, :active, :boolean
  4 + end
  5 +end
... ...
  1 +# encoding: UTF-8
  2 +# This file is auto-generated from the current state of the database. Instead
  3 +# of editing this file, please use the migrations feature of Active Record to
  4 +# incrementally modify your database, and then regenerate this schema definition.
  5 +#
  6 +# Note that this schema.rb definition is the authoritative source for your
  7 +# database schema. If you need to create the application database on another
  8 +# system, you should be using db:schema:load, not running all the migrations
  9 +# from scratch. The latter is a flawed and unsustainable approach (the more migrations
  10 +# you'll amass, the slower it'll run and the greater likelihood for issues).
  11 +#
  12 +# It's strongly recommended that you check this file into your version control system.
  13 +
  14 +ActiveRecord::Schema.define(version: 20160419084655) do
  15 +
  16 + create_table "certificates", force: :cascade do |t|
  17 + t.string "key"
  18 + t.string "cert"
  19 + t.datetime "created_at", null: false
  20 + t.datetime "updated_at", null: false
  21 + t.boolean "active"
  22 + end
  23 +
  24 +end
... ...
  1 +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
  2 +
  3 +one:
  4 + key: MyString
  5 + cert: MyString
  6 +
  7 +two:
  8 + key: MyString
  9 + cert: MyString
... ...
  1 +require 'test_helper'
  2 +
  3 +class CertificateTest < ActiveSupport::TestCase
  4 + # test "the truth" do
  5 + # assert true
  6 + # end
  7 +end
... ...
Please register or login to post a comment