Sha256: 10b545edb082dc514f61b8a723d7e877b8e925a76f6bd221c96b720ba2040f47

Contents?: true

Size: 376 Bytes

Versions: 2

Compression:

Stored size: 376 Bytes

Contents

class Version
  include MongoMapper::Document
  include Comparable
  
  key :number, Integer
  key :versioned_type, String
  key :versioned_id, ObjectId
  key :changes, Hash
  timestamps!

  belongs_to :versioned, :polymorphic => true
  def changes
    read_attribute(:changes)
  end
  alias_attribute :version, :number

  def <=>(other)
    number <=> other.number
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
mrkurt-versioned-0.1.0 lib/version.rb
versioned-0.1.0 lib/version.rb