module Concerns::Event::Comparison::InstanceMethods

Public Instance Methods

<=>(other) click to toggle source
# File app/models/concerns/event/comparison.rb, line 33
def <=>(other)
  return -1 if other.nil? || !other

  if date 
    if other.date
      return date <=> other.date
    else
      return -1
    end
  elsif other.date
    return 1
  end 

  unless new_record? || other.new_record?
    return id <=> other.id
  end

  0
end
==(other) click to toggle source
# File app/models/concerns/event/comparison.rb, line 9
def ==(other)
  if self.equal?(other)
    return true
  end

  if other.nil? || !other || new_record? || other.new_record?
    return false
  end

  id == other.id
end
eql?(other) click to toggle source
# File app/models/concerns/event/comparison.rb, line 21
def eql?(other)
  if self.equal?(other)
    return true
  end

  if other.nil? || !other || new_record? || other.new_record?
    return false
  end

  id == other.id
end