Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Only rewrite implied model names #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jebw
Copy link

@jebw jebw commented Apr 30, 2014

If a model name comes from the translations (ie User.class.model_name.human)
or if it has been supplied by the user (options[:object_name]) then show it
as is.

Only rewrite underscores if it has been derived from the supplied model, i.e.

error_messages_for :user

If a model name comes from the translations (ie User.class.model_name.human)
or if it has been supplied by the user (options[:object_name]) then show it
as is.

Only rewrite underscores if it has been derived from the supplied model, i.e.

  error_messages_for :user
@@ -292,9 +292,6 @@ def test_error_messages_for_many_objects
# any default works too
assert_dom_equal %(<div class="error_explanation" id="error_explanation"><h2>2 errors prohibited this monkey from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "monkey")

# should space object name
assert_dom_equal %(<div class="error_explanation" id="error_explanation"><h2>2 errors prohibited this chunky bacon from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "chunky_bacon")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing a test instead of adding one ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants