Class: PaperTrailAudit::Change

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/paper_trail-audit/change.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#new_valueObject

Returns the value of attribute new_value.



4
5
6
# File 'lib/paper_trail-audit/change.rb', line 4

def new_value
  @new_value
end

#old_valueObject

Returns the value of attribute old_value.



4
5
6
# File 'lib/paper_trail-audit/change.rb', line 4

def old_value
  @old_value
end

#timeObject

Returns the value of attribute time.



4
5
6
# File 'lib/paper_trail-audit/change.rb', line 4

def time
  @time
end

#whodunnitObject

Returns the value of attribute whodunnit.



4
5
6
# File 'lib/paper_trail-audit/change.rb', line 4

def whodunnit
  @whodunnit
end

Instance Method Details

#==(other) ⇒ Object

validates [:old_value,:new_value,:time], presence: true validates :next, presence: true validates :time, presence: true



8
9
10
11
12
13
# File 'lib/paper_trail-audit/change.rb', line 8

def ==(other)
  self.old_value == other.old_value &&
  self.new_value == other.new_value &&
  self.time == other.time &&
  self.whodunnit == other.whodunnit
end