Skip to content

association_preload.rb:336: warning: Object#type is deprecated #157

Closed
wants to merge 3 commits into from
View
2 activerecord/lib/active_record/association_preload.rb
@@ -333,7 +333,7 @@ def preload_belongs_to_association(records, reflection, preload_options={})
table_name = klass.quoted_table_name
primary_key = reflection.options[:primary_key] || klass.primary_key
- column_type = klass.columns.detect{|c| c.name == primary_key}.type
+ column_type = klass.columns.detect{|c| c.name == primary_key}.class
ids = id_map.keys.map do |id|
if column_type == :integer
id.to_i
Something went wrong with that request. Please try again.