From 70eccaa392e96bfa9cad1a600f9f770aca844f51 Mon Sep 17 00:00:00 2001 From: Moises Machado Date: Tue, 10 Feb 2009 06:46:56 -0300 Subject: [PATCH] ActionItem930: changed notify_comments default to true --- db/migrate/062_article_notify_comments_change_default.rb | 9 +++++++++ db/schema.rb | 4 ++-- test/unit/article_test.rb | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 db/migrate/062_article_notify_comments_change_default.rb diff --git a/db/migrate/062_article_notify_comments_change_default.rb b/db/migrate/062_article_notify_comments_change_default.rb new file mode 100644 index 0000000..7ff82a6 --- /dev/null +++ b/db/migrate/062_article_notify_comments_change_default.rb @@ -0,0 +1,9 @@ +class ArticleNotifyCommentsChangeDefault < ActiveRecord::Migration + def self.up + change_column_default :articles, :notify_comments, true + end + + def self.down + change_column_default :articles, :notify_comments, false + end +end diff --git a/db/schema.rb b/db/schema.rb index dfebde8..5adbd04 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 61) do +ActiveRecord::Schema.define(:version => 62) do create_table "article_versions", :force => true do |t| t.integer "article_id" @@ -73,7 +73,7 @@ ActiveRecord::Schema.define(:version => 61) do t.boolean "accept_comments", :default => true t.integer "reference_article_id" t.text "setting" - t.boolean "notify_comments", :default => false + t.boolean "notify_comments", :default => true t.integer "hits", :default => 0 end diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index b5b536e..e65af2c 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -584,9 +584,9 @@ class ArticleTest < Test::Unit::TestCase assert !a.belongs_to_blog? end - should 'has comments notifier false by default' do + should 'has comments notifier true by default' do a = Article.new - assert !a.notify_comments? + assert a.notify_comments? end should 'hold hits count' do @@ -615,4 +615,5 @@ class ArticleTest < Test::Unit::TestCase assert_respond_to a, :can_display_hits? assert_equal true, a.can_display_hits? end + end -- libgit2 0.21.2