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

allow the :converter Proc form composed_of to return nil #6143

Merged
merged 1 commit into from May 21, 2012

Conversation

senny
Copy link
Member

@senny senny commented May 3, 2012

This makes it possible to filter invalid input values before they are passed
into the value-object (like empty strings). This behaviour is only relevant
if the :allow_nil options is set to true. Otherwise you will get
the resulting NoMethodError.

This pull-request is the same as #3421 but with the correct merge target.

This makes it possible to filter invalid input values before they are passed
into the value-object (like empty strings). This behaviour is only relevant
if the :allow_nil options is set to true. Otherwise you will get
the resulting NoMethodError.
@senny
Copy link
Member Author

senny commented May 3, 2012

@rafaelfranca here is the new pull-request.

@alup
Copy link
Contributor

alup commented May 4, 2012

+1 ... This should be marked with the "ActiveRecord" label.

@thbar
Copy link

thbar commented May 5, 2012

+1

@rafaelfranca
Copy link
Member

cc @tenderlove @jonleighton

@thbar
Copy link

thbar commented May 7, 2012

FWIW, our use case here is to support nil with the money gem (which recommends using composed_of).

@senny
Copy link
Member Author

senny commented May 21, 2012

@rafaelfranca any progress on this one?

@rafaelfranca
Copy link
Member

I'm not familiar with the Active Record internals. The implementation looks fine to me, but I don't want to get this without talk with @jonleighton or @tenderlove. I'll try to contact they today and give you an answer.

tenderlove added a commit that referenced this pull request May 21, 2012
allow the :converter Proc form composed_of to return nil
@tenderlove tenderlove merged commit 525839f into rails:master May 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants