draper/lib/draper
Bruno Castro 5e4f529bb8 fix: Make CollectionDecorator respond_to? to ORM methods (#850)
## Testing
1. Create a decorator for the model and its association
```ruby
class OrderHistoryDecorator < Draper::Decorator
  delegate_all
end

class OrderDecorator < Draper::Decorator
  delegate_all

  decorates_association :order_histories, with: OrderHistoryDecorator
end
```

2. Call `respond_to?` with some ORM method allowed by the strategy
```ruby
[1] pry(main)> order.order_histories.decorate.respond_to?(:includes)
=> true
```

## References
* method_missing [usage](https://thoughtbot.com/blog/always-define-respond-to-missing-when-overriding)
2019-03-16 14:15:16 -05:00
..
compatibility Feature: ActiveJob Integration and Documentation (#817) 2017-09-11 09:35:14 -07:00
decoratable Rename `source` to `object` 2013-04-30 14:10:52 +01:00
query_methods feat: Include ORM associations in CollectionDecorator (#845) 2019-02-25 10:44:19 -06:00
tasks Replace hash rockets with new syntax (#802) 2017-05-08 09:28:07 -05:00
test Remove previously deprecated functionality. (#785) 2017-03-29 10:26:07 -05:00
view_context Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
automatic_delegation.rb Don't do runtime delegation, delegate explicitly (#789) 2017-04-03 11:24:01 -05:00
collection_decorator.rb feat: Include ORM associations in CollectionDecorator (#845) 2019-02-25 10:44:19 -06:00
configuration.rb feat: Include ORM associations in CollectionDecorator (#845) 2019-02-25 10:44:19 -06:00
decoratable.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
decorated_association.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
decorates_assigned.rb Revert "Merge pull request #480 from urbanautomaton/decorator-namespace-option" 2013-03-10 09:27:12 +01:00
decorator.rb Let decorator_class infer anonymous class' decorator from superclass (#820) 2017-09-14 07:48:01 -07:00
delegation.rb Rename `source` to `object` 2013-04-30 14:10:52 +01:00
factory.rb Decorate structs as singular objects (and not as collections) 2014-06-03 16:46:22 -04:00
finders.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
helper_proxy.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
helper_support.rb add new lines 😓 2012-04-25 23:12:30 +03:00
lazy_helpers.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
query_methods.rb fix: Make CollectionDecorator respond_to? to ORM methods (#850) 2019-03-16 14:15:16 -05:00
railtie.rb Add support for custom default controller configuration (#788) 2017-03-31 09:05:15 -05:00
test_case.rb Move view context clear to before_setup (minitest) (#839) 2019-01-07 08:27:05 -06:00
undecorate.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
version.rb Release v3.1.0 (#848) 2019-03-14 12:42:09 -05:00
view_context.rb Clean view context when controller changes (#799) 2017-05-08 09:23:13 -05:00
view_helpers.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00