module PaperTrailGlobalid::VersionConcern
Public Instance Methods
actor()
click to toggle source
Returns an object which was responsible for a change you need to store global_id to whodunnit field to make this method return the object(who was responsible) for example, whodunnit => “gid://app/Order/1” then whodunnit_user will return Order.find_by(id: 1) in application scope.
# File lib/paper_trail_globalid/version_concern.rb, line 15 def actor ::GlobalID::Locator.locate(whodunnit) || whodunnit end
whodunnit=(value)
click to toggle source
Calls superclass method
# File lib/paper_trail_globalid/version_concern.rb, line 3 def whodunnit=(value) if value.is_a? ActiveRecord::Base super(value.to_gid) else super end end