-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change version association database and table name. #16
Comments
I appreciate that you asked this question in the issues section and want to encourage that. It is likely this functionality has not been implemented and will likely require a PR to achieve the functionality you desire. If you would like to take a stab at this it let me know, otherwise I will try to take a look into this when I have time and see what I can come up with. |
@westonganger I believe that this is not a priority since we have a workaround that is patching the #config/initializers/paper_trail.rb
PaperTrail.config.track_associations = true
PaperTrail::VersionAssociation.class_eval do
self.table_name = 'version_associations'
connects_to database: { writing: :versions_db, reading: :versions_db }
end |
Yes I understand, however someone may want to use different databases per model. We should be able to support this case. |
Love this solution. Unfortunately it is broken in Rails 6.1:
I think per model configuration would be ideal but as far as I can tell there is no other per model configuration yet (so a bit trickier to get going with a PR). The main point of integration as far as app models are concerned is the I'm thinking of adding an abstract class that is parent of |
Same issue here, we used to patch the model but it doesn't work on 6.1 anymore. Any hints? |
I'm trying to use papetrail and papetrail association track storing its data into a different database.
I achieved that for the
PaperTrail::Version
model by following the papetrail docI saw the following comment on the
PaperTrail::VersionAssociation
class:But I'm not quite sure how to change the behavior of the
PaperTrail::VersionAssociation
as I did in thePaperTrail::Version
.I also posted this question on stackoverflow
The text was updated successfully, but these errors were encountered: