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 optional: true to Snapshot user relationship #35

Closed westonganger closed 1 year ago

westonganger commented 1 year ago

Add optional: true to the Snapshot belongs_to :user relationship.

Also added ActiveRecord model-level config option belongs_to_required_by_default to ensure belongs_to validations are enforced because Rails was ignoring the application config for config.active_record.belongs_to_required_by_default. See here for more details, https://github.com/rails/rails/pull/46047 (may be additional action items somewhere after that PR is merged)