Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7154: check_type_in_array_conversion.diff

File check_type_in_array_conversion.diff, 0.6 kB (added by jeremymcanally, 2 years ago)
  • activesupport/lib/active_support/core_ext/array/conversions.rb

    old new  
    3737              if respond_to?(:empty?) && self.empty? 
    3838                "null" 
    3939              else 
    40                 collect { |element| element.id }.join(",") 
     40                collect { |element| element.is_a?(ActiveRecord::Base) ? element.id : element.to_s }.join(",") 
    4141              end 
    4242            else 
    4343              to_default_s