diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/association_preload.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 3fb3642125..8e71c6eec5 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -385,7 +385,7 @@ module ActiveRecord conditions << table["#{interface}_type"].eq(base_class.sti_name) end - conditions += append_conditions(reflection, preload_options) + conditions.concat append_conditions(reflection, preload_options) find_options = { :select => preload_options[:select] || options[:select] || table[Arel.star], @@ -397,9 +397,7 @@ module ActiveRecord associated_records(ids) do |some_ids| method = in_or_equal(some_ids) - where = conditions.inject(table[key].send(*method)) do |ast, cond| - ast.and cond - end + where = table.create_and(conditions + [table[key].send(*method)]) reflection.klass.scoped.apply_finder_options(find_options.merge(:conditions => where)).to_a end |