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

Consider implementing autoload for Active Support #116

Open
jrmhaig opened this issue Sep 27, 2023 · 4 comments
Open

Consider implementing autoload for Active Support #116

jrmhaig opened this issue Sep 27, 2023 · 4 comments

Comments

@jrmhaig
Copy link
Collaborator

jrmhaig commented Sep 27, 2023

#115 adds a fix to maintain compatibility with factory_bot_rails. As noted in the description of the PR there are other options that may be better, such as the autoload functionality in Active Support.

@tagliala
Copy link
Contributor

tagliala commented Oct 1, 2023

Thanks. I can do the switch, but at the moment I do not know if it is worth.

Unfortunately I do not have the experience to understand the difference.

autoload is used, for example, in a gem which patches AR but does not have this issue with factory bot rails like Active Record Extended

Autoload PR: GeorgeKaraszi/ActiveRecordExtended#82

@jrmhaig
Copy link
Collaborator Author

jrmhaig commented Oct 1, 2023

No problem. If the current method works then I wouldn't worry about it too much. I'm currently having another look at sorting out the unit tests as I am not confident about making changes without understanding the effects.

@oskargargas
Copy link

After updating amoeba I see errors with initializers for:

Which all use ActiveSupport.on_load :active_record somewhere in code from what I checked.

It looks like wrapping initializers into ActiveSupport.on_load :active_record block works as a workaround. Thou I'll pin amoeba at 3.2 as less important element in my system.

Do you consider it as something that can be fixed with amoeba going autoload route? Or it's a bug that should also be submitted to Audited and ActiveSnapshot?

@tagliala
Copy link
Contributor

Do you consider it as something that can be fixed with amoeba going autoload route?

Can't tell, not an expert of autoload mechanisms

I see errors with initializers

Can you please provide a reduced test case?

You can start with: https://github.com/diowa/ruby3-rails7-bootstrap-heroku

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

3 participants