method
symbol_unscoping
v4.2.1 -
Show latest stable
- Class:
ActiveRecord::QueryMethods
symbol_unscoping(scope)private
No documentation available.
# File activerecord/lib/active_record/relation/query_methods.rb, line 887
def symbol_unscoping(scope)
if !VALID_UNSCOPING_VALUES.include?(scope)
raise ArgumentError, "Called unscope() with invalid unscoping argument ':#{scope}'. Valid arguments are :#{VALID_UNSCOPING_VALUES.to_a.join(", :")}."
end
single_val_method = Relation::SINGLE_VALUE_METHODS.include?(scope)
unscope_code = "#{scope}_value#{'s' unless single_val_method}="
case scope
when :order
result = []
when :where
self.bind_values = []
else
result = [] unless single_val_method
end
self.send(unscope_code, result)
end