Sha256: 0361fdde85dc3b3c8591696eb3c1ed1e43ec46bb270d158ab71402b0f4020de5

Contents?: true

Size: 411 Bytes

Versions: 33

Compression:

Stored size: 411 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, :uniqueness => true

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
smartkiosk-server-0.12.1 app/models/agent.rb
smartkiosk-server-0.12 app/models/agent.rb
smartkiosk-server-0.11.11 app/models/agent.rb
smartkiosk-server-0.11.10 app/models/agent.rb
smartkiosk-server-0.11.9 app/models/agent.rb
smartkiosk-server-0.11.8 app/models/agent.rb
smartkiosk-server-0.11.7 app/models/agent.rb
smartkiosk-server-0.11.6 app/models/agent.rb
smartkiosk-server-0.11.5 app/models/agent.rb
smartkiosk-server-0.11.4 app/models/agent.rb
smartkiosk-server-0.11.3 app/models/agent.rb
smartkiosk-server-0.11.2 app/models/agent.rb
smartkiosk-server-0.11.1 app/models/agent.rb
smartkiosk-server-0.11 app/models/agent.rb
smartkiosk-server-0.10.19 app/models/agent.rb
smartkiosk-server-0.10.18 app/models/agent.rb
smartkiosk-server-0.10.17 app/models/agent.rb
smartkiosk-server-0.10.16 app/models/agent.rb
smartkiosk-server-0.10.15 app/models/agent.rb
smartkiosk-server-0.10.14 app/models/agent.rb