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