Generated model Question with migration
This commit is contained in:
2
app/models/question.rb
Normal file
2
app/models/question.rb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
class Question < ActiveRecord::Base
|
||||||
|
end
|
||||||
9
db/migrate/20140227235855_create_questions.rb
Normal file
9
db/migrate/20140227235855_create_questions.rb
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
class CreateQuestions < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :questions do |t|
|
||||||
|
t.text :title
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
7
test/fixtures/questions.yml
vendored
Normal file
7
test/fixtures/questions.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
title: MyText
|
||||||
|
|
||||||
|
two:
|
||||||
|
title: MyText
|
||||||
7
test/models/question_test.rb
Normal file
7
test/models/question_test.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class QuestionTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user