-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
v4.4.0 NoMethodError: undefined method `belong_to' #1332
Comments
Ditto. Seems like pretty much all the association matchers broke for us.
|
Faced the same issue. Seems like the problem with autoloading. When just writing |
Same here. So this might be this commit? |
It seems to be a feature, not a bug. The release notes of
|
@timlapluie but everything was fine in 4.3.0 |
@Volosh1n sorry, messed up the version number. This feature has been added with |
@timlapluie all the matchers don't work. Validations as well. Besides, have you read the error message in first comment? How come that undefined method is a proper error? Also, have you read my comment where the fix is pretty simple but stupid? |
Nope, this breaks all association matchers, not just through associations. |
As @denisj mentioned, its because of the above mentioned commit change from require to autoloading the constants. require "shoulda/matchers/active_record/association_matcher"
require "shoulda/matchers/active_record/association_matchers"
require "shoulda/matchers/active_record/association_matchers/counter_cache_matcher"
require "shoulda/matchers/active_record/association_matchers/inverse_of_matcher"
require "shoulda/matchers/active_record/association_matchers/join_table_matcher"
require "shoulda/matchers/active_record/association_matchers/order_matcher"
require "shoulda/matchers/active_record/association_matchers/through_matcher"
require "shoulda/matchers/active_record/association_matchers/dependent_matcher"
require "shoulda/matchers/active_record/association_matchers/required_matcher"
require "shoulda/matchers/active_record/association_matchers/optional_matcher"
require "shoulda/matchers/active_record/association_matchers/source_matcher"
require "shoulda/matchers/active_record/association_matchers/model_reflector"
require "shoulda/matchers/active_record/association_matchers/model_reflection"
require "shoulda/matchers/active_record/association_matchers/option_verifier" or just add Just for verification |
Thank you all for the information shared here. I will send a correction as soon as possible. |
Fixed in v4.4.1. Sorry everybody! |
With the release of v4.4.0, I'm seeing test failures with errors resembling this:
Reverting to the prior release fixes the issue.
The text was updated successfully, but these errors were encountered: