AshArchival
Dear team,
I am currently trying to implement AshArchival.
In order to be able to read the archived and none archived value. the documentation says I need to create a separate resource.
Shall this separate resource have everything same as the original one, except it does not have the 'extensions: [AshArchival.Resource]' and instead have the
Should I also duplicate all the policies, calculation etc... too ?
Regards,
Angy.
6 Replies
To add to my previous post : should ai only duplicate the attributes and that is all ?
You shouldn't have to create a separate resource for the archived items.
Then set up your policies to allow some user groups to read_archived, read_all, and unarchive.
The base filter means the default read will always filter out archived records
The archive block specifies which actions are excluded from the base filter.
I forgot why I have base_filter_sql in the postgres block and base_filter in the resource block. Did it awhile back, but seems to work ok.
But, it all depends on how you want to model your domain. If you want to have a Foo resource and an ArchivedFoo resource pointing to the same table with different base filters, that works too
Sometimes it is helpful to break them apart, but for my use case I didn't
How, thanks. I will try to implement it 🙂 and will let you know my progress 🙂
Are you sure that works? I didn't think the base filter was compatible with the exclude read actions option
I think you have to do it without the base filter?
I’d have to ask Rebecca since she fought with the archival stuff for a while on my app. Pretty sure your only need to do the archival block base filter. I’ll check with her when she some online and post the answer here.
I don't know of a way to bypass the base filter on a resource is all 😂