Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails - STI bug for ActiveRecord_Relation, works fine for a single record #924

Open
james-em opened this issue May 26, 2023 · 0 comments
Open

Comments

@james-em
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant