Sha256: 6fde24d7722e85b0ec59a27d5ba9b2725c3bf151713345c9d58a698e892ccba4

Contents?: true

Size: 390 Bytes

Versions: 4

Compression:

Stored size: 390 Bytes

Contents

class Agent < ActiveRecord::Base
  include Redis::Objects::RMap

  has_rmap({:id => lambda{|x| x.to_s}}, :title)
  has_paper_trail

  #
  # RELATIONS
  #
  scope :root, where(:agent_id => nil)

  has_many :terminals
  has_many :agents
  has_many :commissions
  has_many :payments, :order => 'id DESC'

  belongs_to :agent

  #
  # VALIDATIONS
  #
  validates :title, :presence => true

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
smartkiosk-server-0.9.3 app/models/agent.rb
smartkiosk-server-0.9.2 app/models/agent.rb
smartkiosk-server-0.9.1 app/models/agent.rb
smartkiosk-server-0.9.0 app/models/agent.rb