diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index e6269c78cf..b93a728a39 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -175,7 +175,11 @@ module ActiveRecord when TrueClass, FalseClass value ? 1 : 0 else - value.to_i + if value.respond_to?(:to_i) + value.to_i + else + nil + end end end |