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

Use ActiveSupport.on_load hook for defining anything on top of AR #43

Merged
merged 1 commit into from
Sep 27, 2019
Merged

Use ActiveSupport.on_load hook for defining anything on top of AR #43

merged 1 commit into from
Sep 27, 2019

Conversation

amatsuda
Copy link
Contributor

@amatsuda amatsuda commented Jun 5, 2019

Another reason that was causing problems like #41 is that this gem touches ActiveRecord::Base from the toplevel.
This should better be delayed until the application defines a model and loads AR::Base, and for that purpose, Rails has ActiveSupport.on_load mechanism.

This simple hook is indeed independent on Rails (Raities) since it's implemented in Active Support and triggered within AR::Base class, so it should work with non-Rails apps.

@johvet
Copy link

johvet commented Aug 18, 2019

👍

@afair afair merged commit 6fc4adb into afair:master Sep 27, 2019
@amatsuda amatsuda deleted the as_on_load branch September 27, 2019 17:24
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

Successfully merging this pull request may close these issues.

None yet

3 participants