Sha256: ef5dbc7d49be68eea42e63430273f57cf08ffe04ecc331173b60c3da72aa772e

Contents?: true

Size: 601 Bytes

Versions: 21

Compression:

Stored size: 601 Bytes

Contents

class SessionRecord < ActiveRecord::Base
  #
  # RELATIONS
  #
  belongs_to :terminal

  #
  # VALIDATIONS
  #
  validates :terminal, :presence => true
  validates :message_id, :presence => true, :uniqueness => true
  validates :started_at, :presence => true
  validates :upstream, :presence => true
  validates :downstream, :presence => true
  validates :time, :presence => true

  after_create do
    if terminal.last_session_started_at.blank? ||
       self.started_at > terminal.last_session_started_at

      terminal.update_attribute(:last_session_started_at, self.started_at)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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