Permalink
Browse files

fixing call to columns hash. run the damn tests when you backport!

  • Loading branch information...
tenderlove committed Feb 10, 2013
1 parent 697f31c commit d29235d2a4df94b6db7d3e45ab15a6799363384e
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -53,7 +53,7 @@ def self.build_from_hash(engine, attributes, default_table, allow_table_name = t
attribute.eq(value.name)
when Integer, ActiveSupport::Duration
# Arel treats integers as literals, but they should be quoted when compared with strings
- column = engine.connection.schema_cache.columns_hash(table.name)[attribute.name.to_s]
+ column = engine.connection.schema_cache.columns_hash[table.name][attribute.name.to_s]
attribute.eq(Arel::Nodes::SqlLiteral.new(engine.connection.quote(value, column)))
else
attribute.eq(value)

1 comment on commit d29235d

@carlosantoniodasilva

This comment has been minimized.

Show comment Hide comment
@carlosantoniodasilva

carlosantoniodasilva Feb 11, 2013

Owner

@tenderlove hey, actually, isn't it calling this method from schema cache? I guess I don't see the difference :)

@tenderlove hey, actually, isn't it calling this method from schema cache? I guess I don't see the difference :)

Please sign in to comment.