From bde643fbec7d1b80309d3387635f4a2e9dadccc2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 25 Dec 2010 16:42:49 -0700 Subject: arel will deal with casting the ids, so we can delete this --- activerecord/lib/active_record/association_preload.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 3409ca9099..a305551093 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -349,19 +349,7 @@ module ActiveRecord table = klass.arel_table primary_key = (reflection.options[:primary_key] || klass.primary_key).to_s - column_type = klass.columns.detect{|c| c.name == primary_key}.type - - ids = _id_map.keys.map do |id| - if column_type == :integer - id.to_i - elsif column_type == :float - id.to_f - else - id - end - end - - method = in_or_equal(ids) + method = in_or_equal(_id_map.keys) conditions = table[primary_key].send(*method) custom_conditions = append_conditions(reflection, preload_options) -- cgit v1.2.3