Skip to content

Commit

Permalink
Refs #18: Paper model
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBrendel committed Nov 3, 2017
1 parent 2c8fb78 commit c8f82c5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/models/paper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Paper < ActiveRecord::Base
end
11 changes: 11 additions & 0 deletions db/migrate/20171103201744_create_papers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreatePapers < ActiveRecord::Migration
def change
create_table :papers do |t|
t.string :title
t.string :venue
t.integer :year

t.timestamps null: false
end
end
end
10 changes: 9 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20171103130545) do
ActiveRecord::Schema.define(version: 20171103201744) do

create_table "authors", force: :cascade do |t|
t.string "first_name"
Expand All @@ -21,4 +21,12 @@
t.datetime "updated_at", null: false
end

create_table "papers", force: :cascade do |t|
t.string "title"
t.string "venue"
t.integer "year"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end
10 changes: 5 additions & 5 deletions spec/factories/papers.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FactoryGirl.define do
factory :paper do
# title "COMPUTING MACHINERY AND INTELLIGENCE"
# venue "Mind 49: 433-460"
# year 1950
# authors {build_list :author, 1}
title 'COMPUTING MACHINERY AND INTELLIGENCE'
venue 'Mind 49: 433-460'
year 1950
authors { build_list :author, 1 }
end
end
end

0 comments on commit c8f82c5

Please sign in to comment.