paper-trail-gem

Display custom label for User in rails_admin paper_trail history

╄→尐↘猪︶ㄣ 提交于 2019-12-11 23:37:37
问题 When I go to a paper_trail history page in rails_admin, I see User objects in the User column ( #<User:0x007f59a9... ). Is there a way to configure this to use one of the User attributes? I thought I could use object_label_method but I don't seem to be having any luck. Update: I thought this was purely a display issue but paper_trail is actually storing Strings like #<User:0x007f59a9... in the whodunnit column of the versions table rather than IDs. I have overridden user_for_paper_trail in

Getting Paper_trail + Rails_admin + Devise with Multiple 'user' models

女生的网名这么多〃 提交于 2019-12-11 11:06:15
问题 I am developing an app in Rails 3, currently I use Devise as the login and Rails_admin as the admin panel with Paper_trail tracking all changes made by 'user' model... Problem is I have two user models, User and Admin. So a line of code in rails_admin.rb (initiliazer) to setup Paper_trail to track history: config.audit_with :paper_trail, User Is there any way to have paper_trail monitor changes made by both User and Admin, or can it only follow one model? I notice that even when it is set

Is there a list of global configuration options for the PaperTrail gem?

纵然是瞬间 提交于 2019-12-11 08:42:56
问题 Is there a way to find out what is configurable in the initializer -- is it just only version_limit and the deprecated track_associations ? I had a look through the the config code and also searched for "PaperTrail.config." in the [README](https://github.com/airblade/paper_trail/blob/master/README.md]. question originally part of Is it possible to configure PaperTrail gem to ignore attributes globally? 来源: https://stackoverflow.com/questions/41753257/is-there-a-list-of-global-configuration

What's the right way to list all paper_trail versions including associations?

匆匆过客 提交于 2019-12-10 21:54:32
问题 Question regarding the paper_trail gem. When only associations change, a version record won't be created for the main model. So what's the right way to list all versions for a certain record including its associations? Should I query something like this? (The bad point is this SQL query might be long and low performance.) f = "(item_type = 'Place' AND item_id = ?) OR (item_type = 'PlaceName' AND item_id IN (?))" PaperTrail::Version.where(f, @place.id, @place.names.map { |n| n.id }) Or should

Paper_Trail: Show Diff Between Versions

試著忘記壹切 提交于 2019-12-10 15:01:17
问题 I'm new to Rails...using RubyMine as an IDE. I have Paper_Trail saving previous versions of the data "xoi_qb". My view is currently showing the current and previous data as I'd like, but I would like to show the diff between the current version "xoi_qb" and the previous version "xoi_qb". For instance, the current version may be "97" and the previous version may be "94", and I would like to display "XOI +/-: +3". I would like to display this difference and add the "+" or "-" based on the

PaperTrail: info_for_paper_trail outside the context of a controller

孤者浪人 提交于 2019-12-06 06:18:29
问题 I am using the paper_trail gem for versioning my models. So far, my model depends on the info_for_paper_trail method in ApplicationController : class ApplicationController < ActionController::Base # Extra columns to store along with PaperTrail `versions` def info_for_paper_trail { revision_id: @revision.id, revision_source_id: @revision_source.id } end end This works great in context of the controller, but is there a way that I can replicate this sort of thing outside the context of the

Paper_trail gem abilities

ε祈祈猫儿з 提交于 2019-12-05 15:27:19
I was wondering whether the following use case can be achieved using the papertrail gem? A Wikipedia-type of application with wiki pages that logged in users can change/edit and where: Moderators can undo specific changes: I understand papertrail allows to roll back to a previous version but what I’m asking here is somewhat different. That is, the ability to undo a specific edit/change . Suppose there have been three edits/versions to a record/wiki-page. Then if you want to undo edit 2, then changes from edit 1 and 3 should still remain. But if you would roll back to the version before edit 2,

Rails 3.2 app - Should I use a versioning gem (paper_trail or vestal_versions) or handle it manually?

情到浓时终转凉″ 提交于 2019-12-05 09:18:56
My question: Should I roll my own model versioning or use one of the versioning gems that's already out there? If I should use a gem, which one seems best for this application? Info about my app My app is a simple Checklist app. There are Checklists and Jobs, and I track user responses with Responses and Submissions. The Response tells me what the use said ("Done", with a note "We need more mops.") and the Submission tells me when that particular Checklist was filled out (because there may be many submissions and sets of responses for a given checklist). I'll show my associations below, in

Papertrail and Carrierwave

余生长醉 提交于 2019-12-04 18:49:06
问题 I have a model that use both: Carrierwave for store photos, and PaperTrail for versioning. I also configured Carrierwave for store diferent files when updates (That's because I want to version the photos) with config.remove_previously_stored_files_after_update = false The problem is that PaperTrail try to store the whole Ruby Object from the photo (CarrierWave Uploader) instead of simply a string (that would be its url) (version table, column object) --- first_name: Foo last_name: Bar photo:

How to setup admin approval a model's edits

馋奶兔 提交于 2019-12-04 12:00:20
问题 I need a system where a regular user can edit a model but the edits don't actually happen until they are approved by an administrator. I found a gem called paper_trail that does had model versioning but doesn't support specifically what I want to do. I'm wondering how other people have handled this problem. I should add that there are also associations that I would like to be able for the user to edit at the same time. They aren't very complicated, for example one is aliases. The more