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

delocalize value provided in options as long as it is not a String #31

Closed
wants to merge 3 commits into from
Closed

Conversation

Advisa
Copy link

@Advisa Advisa commented Oct 5, 2011

It seems that if a String is specified then that value should not be delocalized, but if a number, date or time object is provided it makes more sense to delocalize it.

@fmluizao
Copy link
Collaborator

fmluizao commented Oct 5, 2011

Makes sense... I think the behavior is more consistent, acording to the rails API.

What do you think @clemens?

@pederbl
Copy link

pederbl commented Nov 9, 2011

What are your thoughts on this? This is a critical fix for me. I would love to get back on your official version instead of using my own.

@clemens
Copy link
Owner

clemens commented Nov 9, 2011

Oh, I had totally forgotten about this one, sorry.

Conceptionally, this looks good. Could you please also add tests for values that are dates/times/datetimes and also a test that verifies that it doesn't modify strings?

After that, I think we're good to merge.

@clemens
Copy link
Owner

clemens commented May 21, 2012

Is this still relevant? If so, could you open another pull request based on the current master and provide the tests I've asked for? Thanks!

clemens added a commit that referenced this pull request Aug 20, 2012
The behavior is similar to what is proposed in pull request/issue #31 while keeping the exissting
behavior for blank strings.
clemens added a commit that referenced this pull request Aug 20, 2012
See pull request/issue #31 for details.
@clemens
Copy link
Owner

clemens commented Aug 20, 2012

I've included your proposed changes in the current master and spike branch. The only change was that I've kept the options[:value].blank? guard so with a blank string it would still fall back to delocalizing the model's own value.

Thanks for contributing. :)

@clemens clemens closed this Aug 20, 2012
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

4 participants