workarea-commerce / workarea-api

Adds JSON REST APIs to the Workarea Commerce Platform
https://www.workarea.com
Other
7 stars 1 forks source link

Ensure DateFiltering is included in models #15

Closed tubbo closed 4 years ago

tubbo commented 4 years ago

To avoid a missing by_updated_at method error in tests, explicitly decorate the models that may autoload ApplicationDocument prior to the API's engine initializer getting called.

NOTE: This change should be more apparent in mega-build or an actual app, since the tests don't fail when running locally.

bencrouse commented 4 years ago

So the actual issue is that any model loaded during initialization isn't going to receive this decoration. Here was the original fix in base: https://github.com/workarea-commerce/workarea/commit/5b0663628480533a78298ebd06ee37fec5a2e8aa

tubbo commented 4 years ago

@bencrouse so can this be backported to v3.4 or is there something in there that's 3.5 specific? 3.4+ is what this version of the API depends on.

bencrouse commented 4 years ago

I don't believe this could be backported. I remember thinking the API-change was the only way I could think of to fix it, so it would have to be fixed in v3.5.