westonganger / active_snapshot

Simplified snapshots and restoration for ActiveRecord models and associations with a transparent white-box implementation
MIT License
103 stars 16 forks source link

Add ability to change storage_method, Change default storage method #32

Closed westonganger closed 1 year ago

westonganger commented 1 year ago

Add alternative storage column options to store snapshots.metadata and snapshot_items.object

More Info:

westonganger commented 1 year ago

@oskargargas do you want to try the latest changes to master and see if that is sufficient for your purposes.

You would need to set

ActiveSnapshot.config do |config|
  #config.storage_method = "serialized_json" # default, for text column
  #config.storage_method = "serialized_yaml" # for text column
  config.storage_method = "native_json" # for json/jsonb column
end