shioyama on master
Add pending specs for translate… (compare)
Ok, so I have some insight into this problem actually. I noticed you're aliasing query results in that SQL (
as coming_30_days etc). That means those attributes will be actually fetched using
method_missing rather than defined methods, which explains the relation to the change in 0.8.12.
For background on that (purely discussion of ActiveRecord), watch my RailsConf talk on the topic: https://www.youtube.com/watch?v=PNNrmNTQx2s&feature=emb_logo
coming_30_dayson your model will end up hitting
method_missing. For a model with Mobility enabled, and using fallthrough accessors (which are there if you're using dirty tracking), you will pass through that code that was changes. So that's the connection.
method_missingis not supposed to actually include keyword arguments:
method_missing(m, *a, &b)
method_missing, is actually breaking the API. Previously it was hiding that by not passing the keyword arguments to
super, but now since it is it can break other stuff. Ironically that was what the original PR was trying to fix.
**options, the options are being converted to a hash, which does not match the signature that ActiveRecord expects.
TranslatedStringand pass that name to
class TranslatedString < ActiveRecord::Base end class Post < ActiveRecord::Base extend Mobility translates :title, backend: :key_value, class_name: TranslatedString end
Hi folks, I've released 1.0.0.alpha :tada:
I'm also working on a wiki page explaining how to update your configuration to use the new version: https://github.com/shioyama/mobility/wiki/Introduction-to-Mobility-v1.0
This is still pre-release and I would really love to hear from anyone who tries to update. The vast majority of changes are around configuration, not around the actual backends, so your code should continue to work as-is as long as the configuraiton is updated correctly.
Alright folks, just released 1.0.0: https://rubygems.org/gems/mobility/versions/1.0.0
I'm working on setting up a website with docs and a blog, but I didn't want to wait anymore on that to avoid more people starting on 0.8. I assume something will go wrong somewhere, just create issues if you see anything unexpected.
For those (I know there are at least a couple) out there using Mobility with Sequel, I'd be curious to hear about your experiences. I mainly keep Sequel support to avoid hard-coding everything to ActiveRecord and because I love learning about Sequel internals, but it can add extra time when ORM-specific features change to port everything. e.g. Mobility supports block-format querying in Sequel like in ActiveRecord so I just had to do some extra work to make it work with the latest changes: shioyama/mobility#479
But I actually have no idea if anyone is even using the block-format query (or query at all) in Sequel...
My ideal solution would be something like having the english translation saved on the "regular" database columns and only use the mobility backend for the other languages
You're in luck! That's a feature that should be released soon: shioyama/mobility#512