aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-11-17 18:33:07 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-11-17 18:34:29 -0800
commit3098579f276d5cecbca0b57e35526b99fadfbe5f (patch)
treebd9a245d1bc6a6a480363c9254cdcd3508ee6ca4
parent52c70d496f34ed4d6c9c8cc1719bc7f86011634b (diff)
downloadrails-3098579f276d5cecbca0b57e35526b99fadfbe5f.tar.gz
rails-3098579f276d5cecbca0b57e35526b99fadfbe5f.tar.bz2
rails-3098579f276d5cecbca0b57e35526b99fadfbe5f.zip
Revert "[PERF] Speed up integer type casting from DB"
This reverts commit 6f7910a and 52c70d4. Query params are type cased through the same method, so this approach doesn't work.
-rw-r--r--activerecord/lib/active_record/type/integer.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/type/integer.rb b/activerecord/lib/active_record/type/integer.rb
index 0149d60b6e..d69e5b3f28 100644
--- a/activerecord/lib/active_record/type/integer.rb
+++ b/activerecord/lib/active_record/type/integer.rb
@@ -12,10 +12,7 @@ module ActiveRecord
:integer
end
- def type_cast_from_database(value)
- return if value.nil?
- value.to_i
- end
+ alias type_cast_for_database type_cast
protected