This commit is contained in:
Brian Lopez 2010-05-13 00:18:21 -07:00
parent 6b285dcd85
commit cf87d9d783

View File

@ -70,7 +70,7 @@ module ActiveRecord
case type
when :string then nil
when :text then nil
when :integer then "#{var_name}.to_i rescue value ? 1 : 0)"
when :integer then "#{var_name}.to_i rescue value ? 1 : 0"
when :float then "#{var_name}.to_f"
when :decimal then "#{self.class.name}.value_to_decimal(#{var_name})"
when :datetime, :timestamp then "#{var_name}.class == Time ? #{var_name} : #{self.class.name}.string_to_time(#{var_name})"