Skip to content

Decorating ActiveRecord::Relation makes the SQL query re-run #947

Open
@jamesst20

Description

@jamesst20

Draper: 4.0.4
Rails: 8.0.1

Could this behavior be avoided?

Image

I understand if I were to do query = query.decorate then run query.map(&:id) for the first time, next calls would be fine, but should we really have to be thinking about when we are decorating vs when the query is going to be executed for the first time? It's like decorating the ActiveRecord::Relation loses the query execution.

Thank you

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions