Skip to content

Commit afc6d10

Browse files
committed
Fix new rubocop 1.70.0 issues
1 parent 686b51b commit afc6d10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/camaleon_cms/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def pending?
8383

8484
# check if this is in draft status
8585
def draft?
86-
status == 'draft' || status == 'draft_child'
86+
%w[draft draft_child].include?(status)
8787
end
8888

8989
def draft_child?

app/models/camaleon_cms/post_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def set_default_site_user_roles
179179

180180
# destroy all custom field groups assigned to this post type
181181
def destroy_field_groups
182-
if !destroyed_by_association.present? && (slug == 'post' || slug == 'page')
182+
if !destroyed_by_association.present? && %w[post page].include?(slug)
183183
errors.add(:base, 'This post type can not be deleted.')
184184
return false
185185
end

0 commit comments

Comments
 (0)