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

Failing test for nested has_many i18n lookup #246

Closed
wants to merge 1 commit into from
Closed

Failing test for nested has_many i18n lookup #246

wants to merge 1 commit into from

Conversation

rywall
Copy link
Contributor

@rywall rywall commented May 3, 2011

I've added a failing test for the i18n lookup of nested has_many models. The lookup will succeed if:

:tag => { :name => 'Nome da empresa' }
is changed to
:tags => { :name => 'Nome da empresa' }

but will fail again if:

f.simple_fields_for(:tags)
is changed to
f.simple_fields_for(:tags, :child_index => 'new_tag')

Maybe I'm just confused about how the lookup is supposed to work?

@carlosantoniodasilva
Copy link
Member

Well, I guess now I see your issue. We do some sort of logic to convert object_name from form builder to the nested array to do the i18n lookup. I guess we're just considering the integer child indexes, and not if you give the child_index option.

Thanks for your work on that, we'll apply it locally and try a fix ok.

@carlosantoniodasilva
Copy link
Member

Hey mate, I worked out a patch to ignore the given child index when doing the model names lookup, could you please give it a try? Let me know if it is working now or we have to review it again. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants