Flowdock
method

symbol_unscoping

Importance_0
v4.2.7 - Show latest stable - 0 notes - Class: ActiveRecord::QueryMethods
symbol_unscoping(scope) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.