mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-27 23:29:52 -04: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
2 changed files with 19 additions and 0 deletions
db/migrate
spec/models
|
@ -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…
Add table
Reference in a new issue