We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 686b51b commit afc6d10Copy full SHA for afc6d10
app/models/camaleon_cms/post.rb
@@ -83,7 +83,7 @@ def pending?
83
84
# check if this is in draft status
85
def draft?
86
- status == 'draft' || status == 'draft_child'
+ %w[draft draft_child].include?(status)
87
end
88
89
def draft_child?
app/models/camaleon_cms/post_type.rb
@@ -179,7 +179,7 @@ def set_default_site_user_roles
179
180
# destroy all custom field groups assigned to this post type
181
def destroy_field_groups
182
- if !destroyed_by_association.present? && (slug == 'post' || slug == 'page')
+ if !destroyed_by_association.present? && %w[post page].include?(slug)
183
errors.add(:base, 'This post type can not be deleted.')
184
return false
185
0 commit comments