aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_decorators_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-09 13:27:15 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-09 13:39:51 -0600
commitd24e6407a7f5d662cb52ed57efc4d8ee11758170 (patch)
treecf3a8925d1776444195a85229e1479e51f9eb849 /activerecord/test/cases/attribute_decorators_test.rb
parent254efb712ac10fd8e165fb34bb459f4abd59b213 (diff)
downloadrails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.tar.gz
rails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.tar.bz2
rails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.zip
Rename `type_cast` to `type_cast_from_database`
In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
Diffstat (limited to 'activerecord/test/cases/attribute_decorators_test.rb')
-rw-r--r--activerecord/test/cases/attribute_decorators_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/attribute_decorators_test.rb b/activerecord/test/cases/attribute_decorators_test.rb
index 416eb650f6..35393753a2 100644
--- a/activerecord/test/cases/attribute_decorators_test.rb
+++ b/activerecord/test/cases/attribute_decorators_test.rb
@@ -12,11 +12,11 @@ module ActiveRecord
super(delegate)
end
- def type_cast(value)
+ def type_cast_from_user(value)
"#{super} #{@decoration}"
end
- alias type_cast_from_user type_cast
+ alias type_cast_from_database type_cast_from_user
end
setup do