mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
5e4f529bb8
## 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) |
||
---|---|---|
.. | ||
draper | ||
generators | ||
draper.rb |