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: Make CollectionDecorator respond_to? to ORM methods #850

Merged
merged 1 commit into from
Mar 16, 2019
Merged

fix: Make CollectionDecorator respond_to? to ORM methods #850

merged 1 commit into from
Mar 16, 2019

Conversation

brunohkbx
Copy link
Contributor

Testing

  1. Create a decorator for the model and its association
class OrderHistoryDecorator < Draper::Decorator
  delegate_all
end

class OrderDecorator < Draper::Decorator
  delegate_all

  decorates_association :order_histories, with: OrderHistoryDecorator
end
  1. Call respond_to? with some ORM method allowed by the strategy
[1] pry(main)> order.order_histories.decorate.respond_to?(:includes)
=> true

References

Copy link
Collaborator

@codebycliff codebycliff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for all the contributions.

@codebycliff codebycliff merged commit 5e4f529 into drapergem:master Mar 16, 2019
@brunohkbx brunohkbx deleted the fix/collection_decorator branch March 16, 2019 19:42
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

2 participants