Skip to content

Slow app boot when trying to observe ActiveRecord::Base #35

Open
@joakimk

Description

@joakimk

If you observe ActiveRecord::Base in order to do something if any model is changed there is some bug in how the observers lists are created causing the app boot to take a long time when eager loading code.

In our case we had an observer that removed comments if a model was destroyed and it had associated comments.

I've reproduced the issue here: https://github.com/barsoom/reproduce_observer_error

We don't use observers in any apps anymore, but thought I'd post this in case someone else had the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions