paper trail gem - Filter paper_trail version history by column -
using airblade's papertrail gem, need track changes particular model columns, need filter selectively see changes 1 particular column. make more concrete, if have file
model has label
attribute/column , want display label history, can right all version history file, include non-label updates other attributes. (furthermore, don't need label update itself, whodunnit
, created_at
associated version.)
i don't see in documentation - closest i've come adding metadata, allows me more access information attribute, doesn't return filtered collection of pertinent version history.
answer: anywhere update label column, can update paper_trail_event, e.g. file.update!(label:'foo', paper_trail_event: 'update label')
. can query on event, e.g. versions.where(event: 'update label')
Comments
Post a Comment