method

symbol_unscoping

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveRecord::QueryMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.0.0.1) is shown here.

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 988
    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

      clause_method = Relation::CLAUSE_METHODS.include?(scope)
      multi_val_method = Relation::MULTI_VALUE_METHODS.include?(scope)
      if clause_method
        unscope_code = "#{scope}_clause="
      else
        unscope_code = "#{scope}_value#{'s' if multi_val_method}="
      end

      case scope
      when :order
        result = []
      else
        result = [] if multi_val_method
      end

      self.send(unscope_code, result)
    end
Register or log in to add new notes.