aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-17 13:39:42 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-17 13:39:42 -0700
commit9ca6948f72bef56445030a60e346376a821dbc72 (patch)
tree669b2e9b835a09067079c2afb3ff86df00e912e1 /activerecord/test/cases/attribute_test.rb
parent1455c4c22feb24b0ff2cbb191afb0bd98ebf7b06 (diff)
downloadrails-9ca6948f72bef56445030a60e346376a821dbc72.tar.gz
rails-9ca6948f72bef56445030a60e346376a821dbc72.tar.bz2
rails-9ca6948f72bef56445030a60e346376a821dbc72.zip
`type_cast_from_user` -> `cast`
Diffstat (limited to 'activerecord/test/cases/attribute_test.rb')
-rw-r--r--activerecord/test/cases/attribute_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/attribute_test.rb b/activerecord/test/cases/attribute_test.rb
index 3b888950e2..aa419c7a67 100644
--- a/activerecord/test/cases/attribute_test.rb
+++ b/activerecord/test/cases/attribute_test.rb
@@ -22,7 +22,7 @@ module ActiveRecord
end
test "from_user + read type casts from user" do
- @type.expect(:type_cast_from_user, 'type cast from user', ['a value'])
+ @type.expect(:cast, 'type cast from user', ['a value'])
attribute = Attribute.from_user(nil, 'a value', @type)
type_cast_value = attribute.value
@@ -68,7 +68,7 @@ module ActiveRecord
end
test "from_user + read_for_database type casts from the user to the database" do
- @type.expect(:type_cast_from_user, 'read from user', ['whatever'])
+ @type.expect(:cast, 'read from user', ['whatever'])
@type.expect(:serialize, 'ready for database', ['read from user'])
attribute = Attribute.from_user(nil, 'whatever', @type)
@@ -102,7 +102,7 @@ module ActiveRecord
end
class MyType
- def type_cast_from_user(value)
+ def cast(value)
value + " from user"
end