Weston Ganger

Results 146 comments of Weston Ganger

Thanks for the kind words. I figured others would end up here after delving into the paper_trail codebase when something goes awry. It gets pretty impossible to reason with. I...

When using Rails with Postgres I have found that I prefer to NOT to use database level foreign key constraints. It usually much more convenient to simply use Rails validations...

One reason to switch to JSON columns would be that we could remove the user_id and user_type columns from `snapshots` table as all info could be stored in `metadata` column....

See issue on pay gem where they discuss JSON problems with MySQL/MariaDB https://github.com/pay-rails/pay/issues/425 Maybe the solution there can be used to mitigate whatever issues were occuring

Yes I suppose we could add the capability to handle this case ```ruby has_snapshot_children do { comments: { records: self.comments, attributes: [:name, :number], } } end ``` We don't read...

Yeah I suppose that would be what is required for this. Also I suppose to be full featured we would probably want to support `only`/`except`

I would probably want to add a class model method `snapshot_options only: [:foo, :bar], children: ->(){ ... }` to handle the parents attributes. Might as well allow the `:children` argument...

Yes you are correct the identifier only needs to be unique for the parent. In that case the uniqueness constraint should be removed. Feel free to create a PR

Developers may not always just want to rollback to the latest version. An identifier allows you to locate any given snapshot much easier. For example if your currently on "Revision...

That being said we can probably make it optional. I also desired to change the identifier option from a positional argument to a named argument so this could be a...