Module Ddb::Userstamp::Stamper::InstanceMethods
In: lib/stamper.rb

Methods

Public Instance methods

Sets the stamper back to nil to prepare for the next request.

[Source]

    # File lib/stamper.rb, line 35
35:         def reset_stamper
36:           Thread.current["#{self.to_s.downcase}_#{self.object_id}_stamper"] = nil
37:         end

Retrieves the existing stamper for the current request.

[Source]

    # File lib/stamper.rb, line 30
30:         def stamper
31:           Thread.current["#{self.to_s.downcase}_#{self.object_id}_stamper"]
32:         end

Used to set the stamper for a particular request. See the Userstamp module for more details on how to use this method.

[Source]

    # File lib/stamper.rb, line 19
19:         def stamper=(object)
20:           object_stamper = if object.is_a?(ActiveRecord::Base)
21:             object.send("#{object.class.primary_key}".to_sym)
22:           else
23:             object
24:           end
25: 
26:           Thread.current["#{self.to_s.downcase}_#{self.object_id}_stamper"] = object_stamper
27:         end

[Validate]