From 86b9ffefe932f5cfc9f356bb0f45455978b8e2d3 Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Fri, 14 May 2010 12:36:22 -0700 Subject: [PATCH] fix another typo in the AR adapter --- lib/active_record/connection_adapters/mysql2_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/mysql2_adapter.rb b/lib/active_record/connection_adapters/mysql2_adapter.rb index e659fc2..825dd44 100644 --- a/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -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 #{var_name} ? 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})"