method
unscope!
v4.2.7 -
Show latest stable
- Class:
ActiveRecord::QueryMethods
unscope!(*args)public
No documentation available.
# File activerecord/lib/active_record/relation/query_methods.rb, line 393
def unscope!(*args) # :nodoc:
args.flatten!
self.unscope_values += args
args.each do |scope|
case scope
when Symbol
symbol_unscoping(scope)
when Hash
scope.each do |key, target_value|
if key != :where
raise ArgumentError, "Hash arguments in .unscope(*args) must have :where as the key."
end
Array(target_value).each do |val|
where_unscoping(val)
end
end
else
raise ArgumentError, "Unrecognized scoping: #{args.inspect}. Use .unscope(where: :attribute_name) or .unscope(:order), for example."
end
end
self
end