draper
draper copied to clipboard
Rails - STI bug for ActiveRecord_Relation, works fine for a single record
Simple explanation of the bug
MyModelBase.all.decorate
=> Could not infer a decorator for MyModelBase. (Draper::UninferrableDecoratorError)
MyModelBase.all.first.decorate
=> #<MyModelSpecificDecorator:0x000000012116d470
Workaround PS: Can cause some performance drawbacks in some cases
MyModelBase.all.map(&:decorate)
Expected behavior
MyModelBase.all.decorate shouldn't raise an error.