-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
HABTM broken promise #12582
Comments
Forgot to mention. It's broken on master. |
Any progress on a test case? |
@spastorino @strzalek we will need a test case on the Rails code base. 😉 |
Yes of course, I can and I will provide that. @tenderlove sorry for no update on this. Few hours after posting this issue my macbook air died. I'll have it back in 4-5 days with replaced ssd and then I will try to attack this issue if anybody won't fix it before. |
@tenderlove thanks a lot! 🤘 |
Seems rails 4.1.0 treats has_and_belongs_to_many as a has_many :through More info on: rails/rails#12582 http://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
Seems rails 4.1.0 treats has_and_belongs_to_many as a has_many :through More info on: rails/rails#12582 http://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
Seems rails 4.1.0 treats has_and_belongs_to_many as a has_many :through More info on: rails/rails#12582 http://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
Seems rails 4.1.0 treats has_and_belongs_to_many as a has_many :through More info on: rails/rails#12582 http://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
Hi! It seems that there are still some issues with HABTM. In Rail 4.1.0.rc1 (and in current 4.1 master) HABTM does not respect has_and_belongs_to_many :languages, validate: false Currently validation is always called for associated objects. For example this code is calling validation ( event = Event.new
event.languages << Language.first
event.valid? Here is minitest about the issue: https://gist.github.com/tanelj/9517608 It works fine in Rails 4.0.3. |
@tanelj nice, thanks for the test case! |
Rails 4.1.0 no longer has that class. It has been replaced with HasManyThroughAssociation rails/rails#12582
Seems rails 4.1.0 treats has_and_belongs_to_many as a has_many :through More info on: rails/rails#12582 http://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
Quoting changelog (https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md) :
It looks like it's not. I wanted to fix issue in AMS yesterday and it turned out it was broken only on edge rails and problem was with HABTM. Here's AMS PR: rails-api/active_model_serializers#404
I'll post proper failing test case for rails & will try to fix this issue later today.
/cc @tenderlove
The text was updated successfully, but these errors were encountered: