For anyone waiting on the dirty tracking fix, it was done, but some issues were pointed out, and I've figured out how to handle them, see: https://github.com/shioyama/mobility/pull/347#issuecomment-544742401
I'll try to get to this on Wednesday. There's an issue that master and the 0-8-stable branch have diverged quite a lot (my fault...), so I need to change them more-or-less separately. But once master is done and passing, I'll make the changes to 0-8 and release 0.8.9.
Hey, sounds like a bit of a challenge you've got there. Let me respond point by point.
Those are my quick thoughts. I won't be doing anything Mobility-related for a while probably, and first priority is cleaning up the code to release v1.0, so the first and second points above would come after that (or possibly as a part of that).
Mobility::Plugins::Fallbacks.with_fallbacks(:en) { # fallbacks are overridden }
master
uses a different plugin config (no longer an assignment, but is a function) but this is not referred to in docs (the docs seem to lag master which makes sense for rubygems users)
To answer your second question (quickly): master is a WIP toward a 1.0 release, so there are some fundamental things that have changed there. They are not yet documented. All released versions are on the 0.8 branch, and I'm keeping 0-8-stable up to date with any new changes I merge in.
It's complicated and wish I could get out the 1.0 release, but just no time right now so for now 0.8 is stable and the one you should use. Make PRs to master and I'll port back to 0.8 and release there for now.
options
in the fallthrough accessor actually has some value (otherwise it would be empty and effectively would not be passed to the super
)
select
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_days
on 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_missing
is 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.
method_missing
without any **options
, the options are being converted to a hash, which does not match the signature that ActiveRecord expects.