aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/tags/base.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-14 16:44:06 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-14 16:44:06 -0700
commit99b6cf538145fb34c08f81a6fc495e7fbb0510ae (patch)
treea55920155a6f7301cf4250f8589faf7c46b27cce /actionview/lib/action_view/helpers/tags/base.rb
parent787e22bb491bd8c36db1e9734261c4ce02c5c5fd (diff)
downloadrails-99b6cf538145fb34c08f81a6fc495e7fbb0510ae.tar.gz
rails-99b6cf538145fb34c08f81a6fc495e7fbb0510ae.tar.bz2
rails-99b6cf538145fb34c08f81a6fc495e7fbb0510ae.zip
Revert "Don't use the `_before_type_cast` version of attributes in the form"
This reverts commit 787e22bb491bd8c36db1e9734261c4ce02c5c5fd.
Diffstat (limited to 'actionview/lib/action_view/helpers/tags/base.rb')
-rw-r--r--actionview/lib/action_view/helpers/tags/base.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/tags/base.rb b/actionview/lib/action_view/helpers/tags/base.rb
index 2b197c33c6..f8abb19698 100644
--- a/actionview/lib/action_view/helpers/tags/base.rb
+++ b/actionview/lib/action_view/helpers/tags/base.rb
@@ -28,6 +28,16 @@ module ActionView
object.public_send @method_name if object
end
+ def value_before_type_cast(object)
+ unless object.nil?
+ method_before_type_cast = @method_name + "_before_type_cast"
+
+ object.respond_to?(method_before_type_cast) ?
+ object.send(method_before_type_cast) :
+ value(object)
+ end
+ end
+
def retrieve_object(object)
if object
object