paper-trail-gem

PaperTrail Manually create version

让人想犯罪 __ 提交于 2020-07-08 06:57:10
问题 I have a spreadsheet of items which I convert to CSV and import using a custom import script into my Rails based application. The spreadsheet contains a row for each record but some rows hold different versions of previous rows. When importing the CSV I currently mark the second row using a "past_version" field but I am now thinking that implementing a full versioning gem would be a much nicer way of going about it. I have been reading through the docs for PaperTrail and it looks perfect for

Paper_trail gem abilities

a 夏天 提交于 2020-01-02 06:21:59
问题 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

Rails 4 x paper_trail: keep track of versions after item is destroyed

六月ゝ 毕业季﹏ 提交于 2019-12-24 12:41:34
问题 This is a follow up question on Rails 4 x paper_trail: filter versions by item_id with nested resources. ————— CONTEXT FROM PREVIOUS QUESTION In my Rails 4 app, I have the following models: class User < ActiveRecord::Base has_many :administrations, dependent: :destroy has_many :calendars, through: :administrations end class Administration < ActiveRecord::Base belongs_to :user belongs_to :calendar end class Calendar < ActiveRecord::Base has_many :administrations, dependent: :destroy has_many

Paper trail manual versioning isn't working as expected

最后都变了- 提交于 2019-12-24 03:09:15
问题 I'm using the paper_trail gem. My use case involves creating versions when I explicitly want to instead of on callbacks like on: [:update] or something. I did so by adding on: [] in my my_model.rb and using paper_trail.touch_with_version on my model instance. The problem is whenever I do this the first time the version is saved with nil attributes. Weird enough, the next time call paper_trail.touch_with_version it saves it correctly with all attributes correctly initialised. Sample logs from

Is it possible to configure PaperTrail gem to ignore attributes globally?

[亡魂溺海] 提交于 2019-12-23 22:06:29
问题 The PaperTrail gem docs state that you can configure individual models to ignore some attributes -- This works great, but I want to skip all updated_at attributes (in every model). Is there a way to do this globally (in an initializer?). Something like PaperTrail.config.ignore = [:updated_at] Related question: Is there a list of global configuration options for the PaperTrail gem? 回答1: Currently (January 2017) there is no global model configuration in PaperTrail. You could do this with a

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

梦想与她 提交于 2019-12-22 07:37:21
问题 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

Display all versions of individual records in Papertrail

陌路散爱 提交于 2019-12-19 11:18:28
问题 I'm building a league system and currently it stores and updates the players 'elo score' depending on the result. Now, I'm trying to add in 'HighCharts' to display the players elo score over the season in a sweet looking line chart. Someone suggested I use Papertrail to store the updates and I have got that all installed. Now here comes my problem, I can't seem to figure out how to spit out the users elo_score versions in an array easy for 'HighCharts' to use. I can get the last updates to

Paper Trail: create a version on parent whenever associated model changes?

我只是一个虾纸丫 提交于 2019-12-19 03:41:55
问题 I'm working on a Rails app where I need to show the audit trail on a Record , which has_many Data . I have paper_trail on my Record, and associated Datum models, and it is saving versions of them just fine. However, what I need is for one version for Record to be created whenever one or more associated Data are changed. Currently, it creates versions on each Datum that changes, but it only creates a version of the Record if the Record's attributes change; it's not doing it when the associated

Paper trail versioning

送分小仙女□ 提交于 2019-12-14 02:46:59
问题 I'm trying to make a version listing with Paper trail, that user will be able to see a difference between versions and get back to the older version. I've found out how to make a listing and links to this versions, but for some reasons, I'm getting an error, when I try to reify the last two versions. It says: undefined method `reify' for nil:NilClass Does anyone knows, what to do about it and what about the diff versioning? # controller def edit @page = Page.find(params[:id]) @versions =

Rails 4 x paper_trail: filter versions by item_id with nested resources

我们两清 提交于 2019-12-12 18:28:24
问题 In my Rails 4 app, I have the following models: class User < ActiveRecord::Base has_many :administrations, dependent: :destroy has_many :calendars, through: :administrations end class Administration < ActiveRecord::Base belongs_to :user belongs_to :calendar end class Calendar < ActiveRecord::Base has_many :administrations, dependent: :destroy has_many :users, through: :administrations end class Post < ActiveRecord::Base belongs_to :calendar end I installed the paper_trail gem to track changes