method

where_unscoping

rails latest stable - Class: ActiveRecord::QueryMethods

Method deprecated or moved

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

where_unscoping(target_value)
private

No documentation available.

# File activerecord/lib/active_record/relation/query_methods.rb, line 907
    def where_unscoping(target_value)
      target_value = target_value.to_s

      self.where_values = where_values.reject do |rel|
        case rel
        when Arel::Nodes::Between, Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual, Arel::Nodes::LessThan, Arel::Nodes::LessThanOrEqual, Arel::Nodes::GreaterThan, Arel::Nodes::GreaterThanOrEqual
          subrelation = (rel.left.kind_of?(Arel::Attributes::Attribute) ? rel.left : rel.right)
          subrelation.name == target_value
        end
      end

      bind_values.reject! { |col,_| col.name == target_value }
    end