diff options
author | Teddy Wing | 2015-01-23 19:45:41 -0500 |
---|---|---|
committer | Teddy Wing | 2015-01-23 19:45:41 -0500 |
commit | c636f067db0f6918872193c8feee86b6ed5dc417 (patch) | |
tree | a21eb4ebbdec224eec0f238703ca54835e94dfcc | |
parent | d7d88ccd11cda59619fea44e14997ed21b5f9a4e (diff) | |
download | Notes-angular-demo-c636f067db0f6918872193c8feee86b6ed5dc417.tar.bz2 |
Generate Note model
-rw-r--r-- | app/models/note.rb | 2 | ||||
-rw-r--r-- | db/migrate/20150124004310_create_notes.rb | 10 | ||||
-rw-r--r-- | test/fixtures/notes.yml | 9 | ||||
-rw-r--r-- | test/models/note_test.rb | 7 |
4 files changed, 28 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb new file mode 100644 index 0000000..1b03bd6 --- /dev/null +++ b/app/models/note.rb @@ -0,0 +1,2 @@ +class Note < ActiveRecord::Base +end diff --git a/db/migrate/20150124004310_create_notes.rb b/db/migrate/20150124004310_create_notes.rb new file mode 100644 index 0000000..41fe6cb --- /dev/null +++ b/db/migrate/20150124004310_create_notes.rb @@ -0,0 +1,10 @@ +class CreateNotes < ActiveRecord::Migration + def change + create_table :notes do |t| + t.string :title + t.text :body + + t.timestamps null: false + end + end +end diff --git a/test/fixtures/notes.yml b/test/fixtures/notes.yml new file mode 100644 index 0000000..e192dee --- /dev/null +++ b/test/fixtures/notes.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + body: MyText + +two: + title: MyString + body: MyText diff --git a/test/models/note_test.rb b/test/models/note_test.rb new file mode 100644 index 0000000..7bbab53 --- /dev/null +++ b/test/models/note_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NoteTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end |