Rails adds #excluding to ActiveRecord::Relation
Rails adds #excluding method for an ActiveRecord::Relation to exclude the specified record (or collection of records) from the resulting relation.
This method is a short-hand for ActiveRecord’s where.not introduced in Rails 4.0.
Read the full blog post: https://blog.saeloun.com/2021/03/08/rails-6-1-adds-excluding-to-active-record-relation
Comments
Rails adds #excluding method for an ActiveRecord::Relation to exclude the specified record (or collection of records) from the resulting relation.
This method is a short-hand for ActiveRecord’s where.not introduced in Rails 4.0.
I’d like to see #excluding as an ActiveSupport extension on hashes/arrays.
Post a comment