mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
introduce Enum
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:bookmark]
|
||||
s.id = PostActionType.types[:bookmark]
|
||||
s.name_key = 'bookmark'
|
||||
s.is_flag = false
|
||||
s.position = 1
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:like]
|
||||
s.id = PostActionType.types[:like]
|
||||
s.name_key = 'like'
|
||||
s.is_flag = false
|
||||
s.icon = 'heart'
|
||||
@@ -14,35 +14,35 @@ PostActionType.seed do |s|
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:off_topic]
|
||||
s.id = PostActionType.types[:off_topic]
|
||||
s.name_key = 'off_topic'
|
||||
s.is_flag = true
|
||||
s.position = 3
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:inappropriate]
|
||||
s.id = PostActionType.types[:inappropriate]
|
||||
s.name_key = 'inappropriate'
|
||||
s.is_flag = true
|
||||
s.position = 4
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:vote]
|
||||
s.id = PostActionType.types[:vote]
|
||||
s.name_key = 'vote'
|
||||
s.is_flag = false
|
||||
s.position = 5
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:spam]
|
||||
s.id = PostActionType.types[:spam]
|
||||
s.name_key = 'spam'
|
||||
s.is_flag = true
|
||||
s.position = 6
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.Types[:custom_flag]
|
||||
s.id = PostActionType.types[:custom_flag]
|
||||
s.name_key = 'custom_flag'
|
||||
s.is_flag = true
|
||||
s.position = 7
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class RemoveTrustLevels < ActiveRecord::Migration
|
||||
def up
|
||||
drop_table :trust_levels
|
||||
change_column_default :users, :trust_level_id, TrustLevel.Levels[:new]
|
||||
change_column_default :users, :trust_level_id, TrustLevel.levels[:new]
|
||||
rename_column :users, :trust_level_id, :trust_level
|
||||
|
||||
update "UPDATE users set trust_level = #{TrustLevel.Levels[:regular]}"
|
||||
update "UPDATE users set trust_level = #{TrustLevel.Levels[:moderator]} where moderator = true"
|
||||
update "UPDATE users set trust_level = #{TrustLevel.levels[:regular]}"
|
||||
update "UPDATE users set trust_level = #{TrustLevel.levels[:moderator]} where moderator = true"
|
||||
|
||||
remove_column :users, :moderator
|
||||
add_column :users, :flag_level, :integer, null: false, default: 0
|
||||
|
||||
Reference in New Issue
Block a user