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

Simplify ActiveModelSupport? #303

Merged
merged 1 commit into from
Oct 11, 2012
Merged

Simplify ActiveModelSupport? #303

merged 1 commit into from
Oct 11, 2012

Conversation

haines
Copy link
Contributor

@haines haines commented Oct 11, 2012

I don't really get why ActiveModelSupport is so complicated.

If I understand correctly (and it's quite likely that I don't!), the point is to proxy to_param, errors, and id to the model, provided they are defined on the model but not on the decorator. But isn't this exactly what Draper does with any other method?!

Granted, to_param is defined on Decorator thanks to ActiveSupport, so it won't be delegated out of the box, but I think we can handle that case by always delegating it.

If I strip it back to basics, leaving just what you see in this pull request, all the specs stay green!

I must have gotten the wrong end of the stick, right?

@steveklabnik
Copy link
Member

Seems good! I don't remember why the're so complex, to be honest.

steveklabnik added a commit that referenced this pull request Oct 11, 2012
@steveklabnik steveklabnik merged commit c299d23 into drapergem:master Oct 11, 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.

2 participants