Arel::In -> Arel::Predicates::In

This commit is contained in:
Jeremy Kemper
2009-11-02 17:49:37 -08:00
parent 36a9644b86
commit e93c2da141
3 changed files with 3 additions and 3 deletions

View File

@@ -1724,7 +1724,7 @@ module ActiveRecord
if (ids_array = select_limited_ids_array(options, join_dependency)).empty?
throw :invalid_query
else
Arel::In.new(
Arel::Predicates::In.new(
Arel::SqlLiteral.new("#{connection.quote_table_name table_name}.#{primary_key}"),
ids_array
)

View File

@@ -84,7 +84,7 @@ module ActiveRecord
else
relation = arel_table(@reflection.options[:join_table])
relation.conditions(relation[@reflection.primary_key_name].eq(@owner.id).
and(Arel::In.new(relation[@reflection.association_foreign_key], records.map(&:id)))
and(Arel::Predicates::In.new(relation[@reflection.association_foreign_key], records.map(&:id)))
).delete
end
end

View File

@@ -71,7 +71,7 @@ module ActiveRecord
else
relation = arel_table(@reflection.table_name)
relation.conditions(relation[@reflection.primary_key_name].eq(@owner.id).
and(Arel::In.new(relation[@reflection.klass.primary_key], records.map(&:id)))
and(Arel::Predicates::In.new(relation[@reflection.klass.primary_key], records.map(&:id)))
).update(relation[@reflection.primary_key_name] => nil)
@owner.class.update_counters(@owner.id, cached_counter_attribute_name => -records.size) if has_cached_counter?