-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fixes Rails autoloader deprecation warning #354
Conversation
Thanks! The build now fails with:
Can you make CI pass? |
@tute tests passed, let me know if you want me to change something else, thanks |
Thanks! I just tested it, but when I launch the |
Actually, I just re-read the related issue and it looks like there's another Deprecation Warning I wasn't aware of
This PR fixes this deprecation message ( Merit::BadgeRules, and Merit::PointRules are the ones we care about ).
In order to see that message
When doing the same on my fix, this is what I get ( Merit::BadgeRules, and Merit::PointRules are not there anymore )
I changed my Gemfile to pull
|
Regarding of # config/initializers/merit.rb
Merit::Badge.create!(
id: 1,
name: "year-member",
description: "Active member for a year",
custom_fields: { difficulty: :silver }
) It should look something like this ( as specified in the logs ) # config/initializers/merit.rb
Rails.application.reloader.to_prepare do
Merit::Badge.create!(
id: 1,
name: "year-member",
description: "Active member for a year",
custom_fields: { difficulty: :silver }
)
end I can update the Readme if you want. |
I had the same problem and solved it exactly as @jairovm suggested: by wrapping everything with |
Got it, thanks! I saw it, good to merge already.
Yes, please! Want to do that as part of this PR or a new one? Thank you both. |
Just changed it within this PR 😅. Thanks @tute |
Thank you!! |
Fixes: ``` DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper, ActionText::TagHelper, Merit::BadgeRules, and Merit::PointRules ``` Also fixes `DEPRECATION WARNING: Initialization autoloaded the constant Merit::Badge` by: - Wrapping `Merit::Badge.create` with `Rails.application.reloader.to_prepare` in `README.md` - Adding `Rails.application.reloader.to_prepare` to `merit.erb` template
Fixes #331