Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Makes form_helper use overriden model accessors backport"

This change introduced breakages and test failures.

This reverts commit 8141f08.
  • Loading branch information...
commit dbbf2fd19c012f68865f797395fdb7191d00dc68 1 parent 9476d62
@NZKoz NZKoz authored
View
6 actionpack/lib/action_view/helpers/form_helper.rb
@@ -877,9 +877,9 @@ def value(object, method_name)
def value_before_type_cast(object, method_name)
unless object.nil?
- object.respond_to?(method_name) ?
- object.send(method_name) :
- object.send(method_name + "_before_type_cast")
+ object.respond_to?(method_name + "_before_type_cast") ?
+ object.send(method_name + "_before_type_cast") :
+ object.send(method_name)
end
end
View
17 actionpack/test/template/form_helper_test.rb
@@ -91,16 +91,6 @@ def post_attributes=(attributes); end
class FormHelperTest < ActionView::TestCase
tests ActionView::Helpers::FormHelper
- class Developer
- def name_before_type_cast
- "David"
- end
-
- def name
- "Santiago"
- end
- end
-
def setup
super
@@ -266,13 +256,6 @@ def test_text_field_doesnt_change_param_values
assert_equal object_name, "post[]"
end
- def test_text_field_from_a_user_defined_method
- @developer = Developer.new
- assert_dom_equal(
- '<input id="developer_name" name="developer[name]" size="30" type="text" value="Santiago" />', text_field("developer", "name")
- )
- end
-
def test_hidden_field
assert_dom_equal '<input id="post_title" name="post[title]" type="hidden" value="Hello World" />',
hidden_field("post", "title")
Please sign in to comment.
Something went wrong with that request. Please try again.