FEATURE: allow moderators to globally pin topics

This commit is contained in:
Sam
2014-04-07 16:38:51 +10:00
parent ae3b2a6e02
commit 0372b81d11
10 changed files with 31 additions and 7 deletions

View File

@@ -0,0 +1,12 @@
class AddPinnedGloballyToTopics < ActiveRecord::Migration
def up
add_column :topics, :pinned_globally, :boolean, null: false, default: false
execute "UPDATE topics set pinned_globally = 't' where category_id = (
SELECT value::int FROM site_settings WHERE name = 'uncategorized_category_id') AND pinned_at IS NOT NULL
"
end
def down
remove_column :topics, :pinned_globally
end
end