owen2345/camaleon-cms

Deprecation warnings using where.not in Rails 6.0

Closed this issue · 0 comments

To reproduce, run the spec using Rails 6.0.

DEPRECATION WARNING: NOT conditions will no longer behave as NOR in Rails 6.1. To continue using NOR conditions, NOT each conditions manually (`.where.not(:id => ...).where.not(:status => ...)`). (called from validate at /Users/briankephart/Sites/camaleon-cms/app/models/camaleon_cms/post.rb:9)

.where.not(id: record.id, status: [:draft, :draft_child, :trash])

Looks like it should be:

.where.not(id: record.id)
.where.not(status: [:draft, :draft_child, :trash])