ash-project / ash_paper_trail

The extension for keeping an audit log of changes to your Ash resources.
https://hexdocs.pm/ash_paper_trail
MIT License
28 stars 13 forks source link

improvement: allow opts to be passed to the generated relationship #92

Closed ahey closed 2 weeks ago

ahey commented 2 weeks ago

This PR adds relationship_opts to the paper_trail dsl. It allows options to be specified that are passed to the generated has_many :paper_trail_versions relationship that is created on the resource. Any options given override the default options in the existing transformer.

This change was made to allow public?: true to be specified, allowing the versions relationship to be exposed over graphql, and adding more flexibility.

I've covered the change with some unit tests, although there was one existing, unrelated failing test that remains in a failing state.

I have also added a few dsl options to the .formatter locals_without_parens that were missing.