instance method symbol_unscoping

Ruby on Rails 5.0.7.2

Since v4.0.13 Last seen in v5.0.7.2 Private — implementation detail, not part of the public API

Available in: v4.0.13 v4.1.16 v4.2.11.3 v5.0.7.2

Signature

symbol_unscoping(scope)

No documentation comment.

Parameters

scope req
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

Defined in activerecord/lib/active_record/relation/query_methods.rb line 988 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::QueryMethods

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close