Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix decorators by making methods non-private
The issue was caused by `draper` gem upgrade (which was a result of upgrading Ruby to v3). The issue was here: https://github.com/drapergem/draper/blob/v4.0.2/lib/draper/automatic_delegation.rb#L10-L26 In decorators we delegate all methods to the decorated object. But this version of the library only does that when there is no private method with the same name on the decorator. In this case, as `admin_user` was a private method on AccountDecorator, draper tried to call `admin_user `on superclass, but it was not there, so it was failing with: ``` ActionView::Template::Error (super: no superclass method `admin_user' for #<AccountDecorator:0x00007f8784266d18 @object=#<Account id: 11, org_name: "Testing" ...> Did you mean? admin_user_email): ``` Removing it from `private_methods` fixed the issue.
- Loading branch information