mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 03:09:43 +00:00
Merge pull request #1913 from davidcelis/default-category-fields
Default values for posts/topics fields on Category
This commit is contained in:
commit
5f992ae34c
@ -0,0 +1,11 @@
|
||||
class AddDefaultsToCategoryPostsAndTopicsFields < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_default :categories, :posts_week, 0
|
||||
change_column_default :categories, :posts_month, 0
|
||||
change_column_default :categories, :posts_year, 0
|
||||
|
||||
change_column_default :categories, :topics_week, 0
|
||||
change_column_default :categories, :topics_month, 0
|
||||
change_column_default :categories, :topics_year, 0
|
||||
end
|
||||
end
|
@ -206,6 +206,14 @@ describe Category do
|
||||
@topic.posts.count.should == 1
|
||||
|
||||
@category.topic_url.should be_present
|
||||
|
||||
@category.posts_week.should == 0
|
||||
@category.posts_month.should == 0
|
||||
@category.posts_year.should == 0
|
||||
|
||||
@category.topics_week.should == 0
|
||||
@category.topics_month.should == 0
|
||||
@category.topics_year.should == 0
|
||||
end
|
||||
|
||||
it "should not set its description topic to auto-close" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user