d44c86f1e5
Public methods defined on the object was being delegated to the decorator even though it was overridden by a private method. ## Testing 1. Create a simple PORO with a public method ```ruby class Job def location Struct.new(:id) { } end end ``` 1. Create a decorator and override the public method with a private ```ruby class JobDecorator < Draper::Decorator delegate_all private def location LocationDecorator.new(object.location) end end ``` 3. It should raise an exception when calling `.location` from the decorator ```ruby [9] pry(main)> JobDecorator.decorate(Job.new).location NoMethodError: private method `location' called for #<JobDecorator:0x0000559f113ba118> ``` ## References * Issue #771 |
||
---|---|---|
.. | ||
draper | ||
generators | ||
draper.rb |