FIX: Don't seed flags if ids don't exist
This can happen if you use the `replace_flags` plugin API to remove a flag.
This commit is contained in:
parent
306d77b54f
commit
c2c99c7c39
|
@ -13,37 +13,47 @@ PostActionType.seed do |s|
|
|||
s.position = 2
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:off_topic]
|
||||
s.name_key = 'off_topic'
|
||||
s.is_flag = true
|
||||
s.position = 3
|
||||
if PostActionType.types[:off_topic]
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:off_topic]
|
||||
s.name_key = 'off_topic'
|
||||
s.is_flag = true
|
||||
s.position = 3
|
||||
end
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:inappropriate]
|
||||
s.name_key = 'inappropriate'
|
||||
s.is_flag = true
|
||||
s.position = 4
|
||||
if PostActionType.types[:inappropriate]
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:inappropriate]
|
||||
s.name_key = 'inappropriate'
|
||||
s.is_flag = true
|
||||
s.position = 4
|
||||
end
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:spam]
|
||||
s.name_key = 'spam'
|
||||
s.is_flag = true
|
||||
s.position = 6
|
||||
if PostActionType.types[:spam]
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:spam]
|
||||
s.name_key = 'spam'
|
||||
s.is_flag = true
|
||||
s.position = 6
|
||||
end
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:notify_user]
|
||||
s.name_key = 'notify_user'
|
||||
s.is_flag = true
|
||||
s.position = 7
|
||||
if PostActionType.types[:notify_user]
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:notify_user]
|
||||
s.name_key = 'notify_user'
|
||||
s.is_flag = true
|
||||
s.position = 7
|
||||
end
|
||||
end
|
||||
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:notify_moderators]
|
||||
s.name_key = 'notify_moderators'
|
||||
s.is_flag = true
|
||||
s.position = 8
|
||||
if PostActionType.types[:notify_moderators]
|
||||
PostActionType.seed do |s|
|
||||
s.id = PostActionType.types[:notify_moderators]
|
||||
s.name_key = 'notify_moderators'
|
||||
s.is_flag = true
|
||||
s.position = 8
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue