-
Notifications
You must be signed in to change notification settings - Fork 87
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
Getting a TypeError when calling obj.i18n.pluck #308
Comments
This looks a bit fishy to me: config.default_options[:default] = proc { |attribute| self[attribute.to_sym] } what if you take that out? |
Also, please post Gemfile or mention what other gems might be involved. |
Removing the :default option didn't change anything but your clue made me remove the :dirty option and now it works. Thank you! |
Hmm... ok so maybe there's a compatibility issue with Dirty then. |
Re-opened this since I'd like to figure out where the compatibility issue is. |
And maybe an incompatibility with :fallbacks and :default. Using the same setup, using fallbacks = :en => :'pt-BR' or the aforementioned default lambda:
Which is pretty comprehensible because only the :en translation is loaded. But what I found weird is that the lambda is not even being called. Should I open another issue? |
No, this is not an issue, it is simply not supported. When you call However, the problem you originally found in this issue would be a bug, once I can confirm it's not related to anything outside of Mobility. |
Ok I've reproduced this, seems to only happen in Rails 5.1.x and not 5.2.x. |
@mendelgusmao #309 should fix this issue with dirty enabled. I'll merge and release the fix once specs pass. |
This is fixed on master and on the 0-8-stable branch. Please try the latter ( |
Fix released in 0.8.7. |
Thank you, @shioyama |
When I try to pluck an attribute from a model that uses the jsonb backend, it raises a TypeError (no implicit conversion of Mobility::Arel::Nodes::Jsonb into String).
Context
I'm using Mobility 0.8.4, Rails 5.1.6 (ActiveRecord 5.1.6), PostgreSQL 10. Here is an excerpt of my code:
Actual Behavior
Thanks for the support!
The text was updated successfully, but these errors were encountered: