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

Ticket #11510: validations.diff

File validations.diff, 0.7 kB (added by igotimac, 6 months ago)

patch to add to_s

  • rails/activerecord/lib/active_record/validations.rb

    old new  
    638638            # sqlite has case sensitive SELECT query, while MySQL/Postgresql don't. 
    639639            # Hence, this is needed only for sqlite. 
    640640            condition_sql = "LOWER(#{record.class.quoted_table_name}.#{attr_name}) #{attribute_condition(value)}" 
    641             condition_params = [value.downcase] 
     641            condition_params = [value.to_s.downcase] 
    642642          end 
    643643 
    644644          if scope = configuration[:scope]