-
Notifications
You must be signed in to change notification settings - Fork 9
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
with_rich_text_#{name} eager loading does not work #18
Comments
Just found out you can do Not sure how to eager load one specific rich text attribute with this though. |
That's good to know @doits, would you feel like submitting a PR (with test) for implementing |
Sure, gave it a try in #23. |
doits
added a commit
to doits/mobility-actiontext
that referenced
this issue
Feb 27, 2022
Since mobility's key value store [loads all translations][1] we check if our is already eager loaded by using [association_cached?][2] before and return it if the locale matches. fixes sedubois#18 [1]: https://github.com/shioyama/mobility/blob/4bf96b713991d5cf379aa6caeae2a3c448c73302/lib/mobility/backends/active_record/key_value.rb#L226 [2]: https://github.com/rails/rails/blob/75a9e1be75769ae633a938d81d51e06852a69ea3/activerecord/lib/active_record/associations.rb#L311
sedubois
pushed a commit
that referenced
this issue
Feb 28, 2022
Since mobility's key value store [loads all translations][1] we check if ours is already eager loaded by using [association_cached?][2] before and return it if the locale matches. fixes #18 [1]: https://github.com/shioyama/mobility/blob/4bf96b713991d5cf379aa6caeae2a3c448c73302/lib/mobility/backends/active_record/key_value.rb#L226 [2]: https://github.com/rails/rails/blob/75a9e1be75769ae633a938d81d51e06852a69ea3/activerecord/lib/active_record/associations.rb#L311
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This test currently does not pass:
mobility-actiontext/test_app/test/mobility_action_text_test.rb
Lines 98 to 106 in 8ad7fbd
Creating this issue for visibility, in case someone would be willing to investigate and offer a PR.
The text was updated successfully, but these errors were encountered: