-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add patch for Rails 5.2.x #31
Conversation
It would be wonderful if this could be accepted. |
@jonkessler |
Given the addition of the |
yeah... wondering the same |
Actually this gem is useless for Rails 5.2 but not for Rails 5.1 and before. |
@n-rodriguez would you consider updating your pull request such that for rails 5.2 only the Thanks again for the efforts! |
I'm on it ;) |
2 tests are broken : 1) Failure:
TestStoreBaseStiClass#test_polymorphic_has_many_through_with_double_sti_on_join_model [/home/nicolas/PROJECTS/GITHUB/store_base_sti_class/test/test_store_base_sti_class.rb:145]:
Expected: "SpecialPost"
Actual: "Post"
2) Failure:
TestStoreBaseStiClass#test_has_many_through_polymorphic_has_one [/home/nicolas/PROJECTS/GITHUB/store_base_sti_class/test/test_store_base_sti_class.rb:116]:
--- expected
+++ actual
@@ -1 +1 @@
-[#<Tagging id: 14, tag_id: 20, polytag_id: nil, polytag_type: nil, taggable_type: "Post", taggable_id: 21>, #<Tagging id: 15, tag_id: 20, polytag_id: nil, polytag_type: nil, taggable_type: "SpecialPost", taggable_id: 22>]
+[#<Tagging id: 14, tag_id: 20, polytag_id: nil, polytag_type: nil, taggable_type: "Post", taggable_id: 21>] |
Thanks for looking into that. Can we isolate the changes that are needed to get those to work? |
Rails 5.2.0 introduces a new method on ActiveRecord classes: '.polymorphic_name'. This method helps us a lot for what we're doing with this gem. However some patches are still needed tp make tests pass. See https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/inheritance.rb#L159
Done! |
Awesome. Taking a look. Edit, heading home. I'll take a look tomorrow morning. Thanks for the updates. |
Thanks for submitting! You're awesome. 🎆 |
You're welcome :) |
Released 1.2.0. |
No description provided.