diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-01 04:14:58 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-01 04:17:56 +0530 |
commit | c62e88a5ab7bc0a70e36dceda2a0f22995a5d087 (patch) | |
tree | 797177d0b0ae34c0a92568b117de5d3f59e10c1a /activerecord/lib/active_record/relation | |
parent | 77c23b2104d62ab1cf1fb5808fef14e38d094605 (diff) | |
download | rails-c62e88a5ab7bc0a70e36dceda2a0f22995a5d087.tar.gz rails-c62e88a5ab7bc0a70e36dceda2a0f22995a5d087.tar.bz2 rails-c62e88a5ab7bc0a70e36dceda2a0f22995a5d087.zip |
Try using cached attribute before creating a new one
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 478d2cb597..08840d102a 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -20,7 +20,7 @@ module ActiveRecord arel_table = Arel::Table.new(table_name, @engine) end - attribute = Arel::Attribute.new(arel_table, column.to_sym) + attribute = arel_table[column] || Arel::Attribute.new(arel_table, column.to_sym) case value when Array, Range, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope |