diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-29 20:15:29 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-29 20:15:32 +0200 |
commit | af6ec607fa9af96569fd2e143147f2dc0ecd583b (patch) | |
tree | 5ae79464e02dcb6b3701fa123de73ccd99ebefa4 /activerecord | |
parent | 67582f08bf86ec71a27363554bc550e929a007f7 (diff) | |
download | rails-af6ec607fa9af96569fd2e143147f2dc0ecd583b.tar.gz rails-af6ec607fa9af96569fd2e143147f2dc0ecd583b.tar.bz2 rails-af6ec607fa9af96569fd2e143147f2dc0ecd583b.zip |
No need to check if the attribute exists (this is the same behavior as in 2.3) [#4994 state:resolved] and [#5003 state:resolved]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index d853fd63d1..5cea2328e8 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -20,9 +20,7 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => @engine) end - unless attribute = table[column] - raise StatementInvalid, "No attribute named `#{column}` exists for table `#{table.name}`" - end + attribute = table[column] || Arel::Attribute.new(table, column) case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation |