Ticket #1732: habtm_finder_sql_fix.2.diff
| File habtm_finder_sql_fix.2.diff, 0.8 kB (added by rtomayko@gmail.com, 3 years ago) |
|---|
-
activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
old new 136 136 end 137 137 138 138 def construct_sql 139 interpolate_sql_options!(@options, :finder_sql)140 141 139 if @options[:finder_sql] 142 @finder_sql = @options[:finder_sql]140 @finder_sql = interpolate_sql(@options[:finder_sql]) 143 141 else 144 142 @finder_sql = "#{@join_table}.#{@association_class_primary_key_name} = #{@owner.quoted_id} " 145 143 @finder_sql << " AND (#{interpolate_sql(@options[:conditions])})" if @options[:conditions]