Class: Osm::Activity::Version

Inherits:
Object
  • Object
show all
Includes:
ActiveAttr::Model, ActiveModel::MassAssignmentSecurity
Defined in:
lib/osm/activity.rb,
lib/osm/activity.rb

Overview

Class Activity::Badge

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Initialize a new Version


# File 'lib/osm/activity.rb', line 409

Instance Attribute Details

#created_byFixnum


395
# File 'lib/osm/activity.rb', line 395

attribute :version, :type => Integer

#created_by_nameString


395
# File 'lib/osm/activity.rb', line 395

attribute :version, :type => Integer

#labelString


395
# File 'lib/osm/activity.rb', line 395

attribute :version, :type => Integer

#versionFixnum


395
# File 'lib/osm/activity.rb', line 395

attribute :version, :type => Integer

Instance Method Details

#<=>(another) ⇒ Object

Compare Version based on activity_id then version


414
415
416
417
418
# File 'lib/osm/activity.rb', line 414

def <=>(another)
  result = self.activity_id <=> another.try(:activity_id)
  result = self.version <=> another.try(:version) if result == 0
  return result
end