Add model Person
This commit is contained in:
parent
b00b838555
commit
7252a6d021
5 changed files with 34 additions and 1 deletions
4
app/models/person.rb
Normal file
4
app/models/person.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Person < ApplicationRecord
|
||||
end
|
9
db/migrate/20181210033105_create_people.rb
Normal file
9
db/migrate/20181210033105_create_people.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePeople < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :people do |t|
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2018_12_10_024922) do
|
||||
ActiveRecord::Schema.define(version: 2018_12_10_033105) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -112,6 +112,11 @@ ActiveRecord::Schema.define(version: 2018_12_10_024922) do
|
|||
t.boolean "confirmed", default: false, null: false
|
||||
end
|
||||
|
||||
create_table "people", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "regional_offices", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
|
6
factories/people.rb
Normal file
6
factories/people.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :person do
|
||||
end
|
||||
end
|
9
spec/models/person_spec.rb
Normal file
9
spec/models/person_spec.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Person do
|
||||
subject { create :person }
|
||||
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Reference in a new issue