diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-11-17 18:09:40 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-11-17 18:09:40 -0800 |
commit | 52c70d496f34ed4d6c9c8cc1719bc7f86011634b (patch) | |
tree | d8bf80244ccded8e46ced180d37835b54c8d603e /activerecord/lib | |
parent | 6f7910aed5ceeb8833de760f396858bee917c7bc (diff) | |
download | rails-52c70d496f34ed4d6c9c8cc1719bc7f86011634b.tar.gz rails-52c70d496f34ed4d6c9c8cc1719bc7f86011634b.tar.bz2 rails-52c70d496f34ed4d6c9c8cc1719bc7f86011634b.zip |
:nail_care: Put escape clause first, keeps @sgrif happy :grin:
See comment on 6f7910a
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/type/integer.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/type/integer.rb b/activerecord/lib/active_record/type/integer.rb index fb6d9df58f..0149d60b6e 100644 --- a/activerecord/lib/active_record/type/integer.rb +++ b/activerecord/lib/active_record/type/integer.rb @@ -13,7 +13,8 @@ module ActiveRecord end def type_cast_from_database(value) - value.to_i unless value.nil? + return if value.nil? + value.to_i end protected |