diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-02-11 22:22:19 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-02-14 01:40:31 +0000 |
commit | a7e19b30ca71f62af516675023659be061b2b70a (patch) | |
tree | f79f1347800952dff958dca5f34f1ce011e365ed /activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb | |
parent | fd7605826a6e4f7590e4abf42c6c9d0923afc4ef (diff) | |
download | rails-a7e19b30ca71f62af516675023659be061b2b70a.tar.gz rails-a7e19b30ca71f62af516675023659be061b2b70a.tar.bz2 rails-a7e19b30ca71f62af516675023659be061b2b70a.zip |
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
Diffstat (limited to 'activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb index 856d826d67..aaa475109e 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb @@ -108,6 +108,10 @@ module ActiveRecord end def process_conditions(conditions, table_name) + if conditions.respond_to?(:to_proc) + conditions = instance_eval(&conditions) + end + Arel.sql(sanitize_sql(conditions, table_name)) end |