module ActiveRecord::QueryMethods

Public Instance Methods

unwhere() click to toggle source

Returns a relation, without all where conditions

Post.where("id = 1").unwhere
# SELECT `posts`.* FROM `posts`
Post.where("id = 1").unwhere.where(trashed: false)
# SELECT `posts`.* FROM `posts` WHERE `trashed` = 0
# File lib/unwhere.rb, line 23
def unwhere
  self.where_clause.clear
  self
end