diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-25 16:42:49 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-25 16:42:49 -0700 |
commit | bde643fbec7d1b80309d3387635f4a2e9dadccc2 (patch) | |
tree | a8837b8d49650b637ba3fb781c730757b1d95c05 /activerecord/lib/active_record | |
parent | 75ac9c4271df65b94b2a6862d87b1ec42f676efe (diff) | |
download | rails-bde643fbec7d1b80309d3387635f4a2e9dadccc2.tar.gz rails-bde643fbec7d1b80309d3387635f4a2e9dadccc2.tar.bz2 rails-bde643fbec7d1b80309d3387635f4a2e9dadccc2.zip |
arel will deal with casting the ids, so we can delete this
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/association_preload.rb | 14 |
1 files changed, 1 insertions, 13 deletions
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) |