diff options
author | Nathan Witmer <nwitmer@gmail.com> | 2008-08-16 13:38:01 -0600 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-08-16 22:23:48 +0100 |
commit | 8cfdcdb35db6e2f6fd5a72a38f4352beab148af1 (patch) | |
tree | 73ee2a1467cfa181807625b7bba10e3bec15b27b /activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | |
parent | 2b69a636c431d62a85b2896d87b69cb13e2b8af0 (diff) | |
download | rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.tar.gz rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.tar.bz2 rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.zip |
Updated has_and_belongs_to_many association to fix :finder_sql interpolation. [#848 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index d516d54151..e7e433b6b6 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -70,10 +70,8 @@ module ActiveRecord end def construct_sql - interpolate_sql_options!(@reflection.options, :finder_sql) - if @reflection.options[:finder_sql] - @finder_sql = @reflection.options[:finder_sql] + @finder_sql = interpolate_sql(@reflection.options[:finder_sql]) else @finder_sql = "#{@owner.connection.quote_table_name @reflection.options[:join_table]}.#{@reflection.primary_key_name} = #{owner_quoted_id} " @finder_sql << " AND (#{conditions})" if conditions |