Class: ActiveRecord::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/left_joins.rb,
lib/left_joins.rb

Defined Under Namespace

Classes: Merger

Instance Method Summary collapse

Instance Method Details

#update_all(*args) ⇒ Object



166
167
168
169
170
171
172
173
174
175
# File 'lib/left_joins.rb', line 166

def update_all(*args)
  local_joins_values = joins_values.clone
  has_left_outer_joins = left_outer_joins_values.any?

  LeftJoins.patch(self, :joins_values, as: ->{ local_joins_values }) do
    LeftJoins.patch(local_joins_values, :any?, as: ->{ super() || has_left_outer_joins }) do
      update_all_without_left_joins_values(*args)
    end
  end
end

#update_all_without_left_joins_valuesObject



164
# File 'lib/left_joins.rb', line 164

alias_method :update_all_without_left_joins_values, :update_all