Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix :restrict_with_error message #10787

Closed
wants to merge 1 commit into from
Closed

fix :restrict_with_error message #10787

wants to merge 1 commit into from

Conversation

kuboon
Copy link

@kuboon kuboon commented May 29, 2013

Suppose User has_many :posts, klass on this context is Post, not User.
We should call human_attribute_name with the owner.

@carlosantoniodasilva
Copy link
Member

Do we have any test case related to this? If not, I'd recommend adding one. Thanks.

@senny
Copy link
Member

senny commented Jun 25, 2013

@kuboon ping, did you have time to add the test-case?

@senny
Copy link
Member

senny commented Aug 15, 2013

It's been three months since we last heard from you. I'm closing this but please report back if you are still interested in this change.

@senny senny closed this Aug 15, 2013
@kuboon kuboon deleted the patch-1 branch August 15, 2013 07:57
@kuboon
Copy link
Author

kuboon commented Aug 15, 2013

I'll retry with proper test cases soon.

@guigs
Copy link
Contributor

guigs commented Aug 19, 2014

I found the same problem. It seems others are facing this too, http://stackoverflow.com/questions/25079733/rails-internationalization-record-is-not-being-translated/25385812.

I can confirm that @kuboon solution fixes the problem.

As a workaround one can use:

  activerecord:
    attributes:
      entity: # Should be the parent class when bug https://github.com/rails/rails/pull/10787 is fixed
        entities: 'entidades'

@guigs
Copy link
Contributor

guigs commented Aug 19, 2014

Probably must be fixed in has_one_association.rb too.

@kuboon
Copy link
Author

kuboon commented Aug 20, 2014

Thank you @guigs.

It's difficult for me to add test cases. I hope anyone to write them.

@kuboon kuboon restored the patch-1 branch December 2, 2014 12:42
@kuboon
Copy link
Author

kuboon commented Dec 4, 2014

@leonardofaria
Copy link

I've just saw that the issue still happens in Rails 4.2.3

@senny senny reopened this Jul 31, 2015
@senny
Copy link
Member

senny commented Jul 31, 2015

@kuboon @leonardofaria could you add a test-case to this PR to prevent against further regressions?

@ronakjangir47
Copy link
Contributor

@senny I open a PR #21581 with the test cases for both has_many and has_one associations.

@senny senny closed this in #21581 Sep 17, 2015
@kuboon kuboon deleted the patch-1 branch October 1, 2015 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants