Commit 70eccaa392e96bfa9cad1a600f9f770aca844f51

Authored by Moises Machado
Committed by Antonio Terceiro
1 parent 3b5490ff

ActionItem930: changed notify_comments default to true

db/migrate/062_article_notify_comments_change_default.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class ArticleNotifyCommentsChangeDefault < ActiveRecord::Migration
  2 + def self.up
  3 + change_column_default :articles, :notify_comments, true
  4 + end
  5 +
  6 + def self.down
  7 + change_column_default :articles, :notify_comments, false
  8 + end
  9 +end
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 # 9 #
10 # It's strongly recommended to check this file into your version control system. 10 # It's strongly recommended to check this file into your version control system.
11 11
12 -ActiveRecord::Schema.define(:version => 61) do 12 +ActiveRecord::Schema.define(:version => 62) do
13 13
14 create_table "article_versions", :force => true do |t| 14 create_table "article_versions", :force => true do |t|
15 t.integer "article_id" 15 t.integer "article_id"
@@ -73,7 +73,7 @@ ActiveRecord::Schema.define(:version =&gt; 61) do @@ -73,7 +73,7 @@ ActiveRecord::Schema.define(:version =&gt; 61) do
73 t.boolean "accept_comments", :default => true 73 t.boolean "accept_comments", :default => true
74 t.integer "reference_article_id" 74 t.integer "reference_article_id"
75 t.text "setting" 75 t.text "setting"
76 - t.boolean "notify_comments", :default => false 76 + t.boolean "notify_comments", :default => true
77 t.integer "hits", :default => 0 77 t.integer "hits", :default => 0
78 end 78 end
79 79
test/unit/article_test.rb
@@ -584,9 +584,9 @@ class ArticleTest &lt; Test::Unit::TestCase @@ -584,9 +584,9 @@ class ArticleTest &lt; Test::Unit::TestCase
584 assert !a.belongs_to_blog? 584 assert !a.belongs_to_blog?
585 end 585 end
586 586
587 - should 'has comments notifier false by default' do 587 + should 'has comments notifier true by default' do
588 a = Article.new 588 a = Article.new
589 - assert !a.notify_comments? 589 + assert a.notify_comments?
590 end 590 end
591 591
592 should 'hold hits count' do 592 should 'hold hits count' do
@@ -615,4 +615,5 @@ class ArticleTest &lt; Test::Unit::TestCase @@ -615,4 +615,5 @@ class ArticleTest &lt; Test::Unit::TestCase
615 assert_respond_to a, :can_display_hits? 615 assert_respond_to a, :can_display_hits?
616 assert_equal true, a.can_display_hits? 616 assert_equal true, a.can_display_hits?
617 end 617 end
  618 +
618 end 619 end