DEV: Extract out compound conditional (#13008)
This commit is contained in:
parent
d4b5a81b05
commit
ee880c4c89
|
@ -785,7 +785,7 @@ class Category < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def update_reviewables
|
||||
if SiteSetting.enable_category_group_moderation? && saved_change_to_reviewable_by_group_id?
|
||||
if should_update_reviewables?
|
||||
Reviewable.where(category_id: id).update_all(reviewable_by_group_id: reviewable_by_group_id)
|
||||
end
|
||||
end
|
||||
|
@ -914,6 +914,10 @@ class Category < ActiveRecord::Base
|
|||
|
||||
private
|
||||
|
||||
def should_update_reviewables?
|
||||
SiteSetting.enable_category_group_moderation? && saved_change_to_reviewable_by_group_id?
|
||||
end
|
||||
|
||||
def check_permissions_compatibility(parent_permissions, child_permissions)
|
||||
parent_groups = parent_permissions.map(&:first)
|
||||
|
||||
|
|
Loading…
Reference in New Issue