From a5d9a1b9b23db67c985a6b9aea8c32b4c2881e75 Mon Sep 17 00:00:00 2001 From: kunal bhandari Date: Mon, 8 Feb 2016 11:28:45 -0500 Subject: [PATCH 1/2] created a model for articles --- LearningRails/app/models/article.rb | 2 ++ .../db/migrate/20160208162811_create_articles.rb | 10 ++++++++++ LearningRails/test/fixtures/articles.yml | 9 +++++++++ LearningRails/test/models/article_test.rb | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 LearningRails/app/models/article.rb create mode 100644 LearningRails/db/migrate/20160208162811_create_articles.rb create mode 100644 LearningRails/test/fixtures/articles.yml create mode 100644 LearningRails/test/models/article_test.rb diff --git a/LearningRails/app/models/article.rb b/LearningRails/app/models/article.rb new file mode 100644 index 0000000..b7ac9f7 --- /dev/null +++ b/LearningRails/app/models/article.rb @@ -0,0 +1,2 @@ +class Article < ActiveRecord::Base +end diff --git a/LearningRails/db/migrate/20160208162811_create_articles.rb b/LearningRails/db/migrate/20160208162811_create_articles.rb new file mode 100644 index 0000000..a5d7f27 --- /dev/null +++ b/LearningRails/db/migrate/20160208162811_create_articles.rb @@ -0,0 +1,10 @@ +class CreateArticles < ActiveRecord::Migration + def change + create_table :articles do |t| + t.string :feedback_id + t.binary :attachment + + t.timestamps null: false + end + end +end diff --git a/LearningRails/test/fixtures/articles.yml b/LearningRails/test/fixtures/articles.yml new file mode 100644 index 0000000..78bc9f1 --- /dev/null +++ b/LearningRails/test/fixtures/articles.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + feedback_id: MyString + attachment: + +two: + feedback_id: MyString + attachment: diff --git a/LearningRails/test/models/article_test.rb b/LearningRails/test/models/article_test.rb new file mode 100644 index 0000000..11c8abe --- /dev/null +++ b/LearningRails/test/models/article_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ArticleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 08058561f67db19de01b0e7df738f965ec2491dc Mon Sep 17 00:00:00 2001 From: skannan5 Date: Fri, 8 Feb 2019 00:09:42 -0500 Subject: [PATCH 2/2] Commit --- LearningRails/sru.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 LearningRails/sru.txt diff --git a/LearningRails/sru.txt b/LearningRails/sru.txt new file mode 100644 index 0000000..40816a2 --- /dev/null +++ b/LearningRails/sru.txt @@ -0,0 +1 @@ +Hi \ No newline at end of file