Closed iberianpig closed 9 months ago
(CI failed)It looks like Rails 7.1.3 breaks polymorphic associations ... :thinking:
@iberianpig see #300 for the Rails 7.1.3 fix
kicking now that 300 was merged
looking like the tests introduced by 299 are still passing. We had introduced a few other changes around a symbol or string column access, so maybe the changes in 299 are no longer needed?
@kbrock Please confirm Reproduce section in this issue. You can reproduce this issue in your terminal.
looking like the tests introduced by 299 are still passing.
I rebased and pushed this branch, then All checks in CI have all passed.
However it's still failing with $ ruby issue.rb
.
1) Failure:
BugTest#test_pluck_with_enumerize [issue.rb:44]:
--- expected
+++ actual
@@ -1 +1 @@
-[["US", "north_america"], ["Canada", "north_america"]]
+[["US", 1], ["Canada", 1]]
1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
@iberianpig Sorry, I was not clear. Let me try again.
Good job. The tests introduced by #269 are still passing. I said this because I thought this reverted the code introduced in #269 but it turns out this is not a revert, but rather a fix for the regression/bug introduced by #269
Request:
Is there a way to introduce a test (that does not rely upon enumerize
) to our code base? I would like to protect us from changing this code and breaking this for you in the future.
Thank you for your feedback.
I've already add tests for #pluck
that it does not rely on enumerize. Could you please take a moment to review them in This PR?
@kbrock When is the release likely to include the contents of this pull request? :smile:
Restore ActiveHash::Relation#pluck to execute the specified method on the record.
Background:
attributes[key]
, affecting compatibility.https://github.com/active-hash/active_hash/pull/269 broke functionality of gems like
enumerize
which rely on casting values accessed by column names.Reproduce
gem "active_hash", "3.2.1" # fail test
.$ ruby issue.rb
3.1.1
3.2.1