samvera-labs / active_encode

Declare encode job classes that can be run by a variety of encoding services
Other
6 stars 8 forks source link

Persistence Mixin #28

Closed cjcolvar closed 6 years ago

cjcolvar commented 6 years ago

This PR adds an optional persistence mixin module that persists/caches a copy of the response from the adapter into an ActiveRecord database table. At this point this cache isn't used for anything but future work could be retrieving from the database if the adapter no longer has the encode due to expiration. This is also a building block for #15.

Since this PR, #14, and later #15 moves toward a Rails engine, this PR does that conversion. This also makes testing easier by having a full Rails context for ActiveRecord testing. If in the future we feel there are strong use cases for a non-Rails version of ActiveEncode then these pieces can be moved into a separate gem.

Fixes #13.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 96.71% when pulling 106c615cc3db95e36e8864ebc85807f10f2ae836 on persistence into 328c5705bcb31d80f26c9ebbd087d2ca74df9beb on master.