Method: ActiveRecord::QueryMethods#or!

Defined in:
activerecord/lib/active_record/relation/query_methods.rb

#or!(other) ⇒ Object

:nodoc:



1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 1157

def or!(other) # :nodoc:
  incompatible_values = structurally_incompatible_values_for(other)

  unless incompatible_values.empty?
    raise ArgumentError, "Relation passed to #or must be structurally compatible. Incompatible values: #{incompatible_values}"
  end

  self.where_clause = where_clause.or(other.where_clause)
  self.having_clause = having_clause.or(other.having_clause)
  self.references_values |= other.references_values

  self
end