Sha256: 3d47d395312e135f33c52e21265d0a1f9d52c31ae12637e4d86b8aeda59e7b84

Contents?: true

Size: 695 Bytes

Versions: 4

Compression:

Stored size: 695 Bytes

Contents

module OpenConferenceWare

  # == Schema Information
  #
  # Table name: session_types
  #
  #  id          :integer          not null, primary key
  #  title       :string(255)
  #  description :text
  #  duration    :integer
  #  event_id    :integer
  #  created_at  :datetime
  #  updated_at  :datetime
  #

  class SessionType < OpenConferenceWare::Base

    # Associations
    belongs_to :event
    has_many :proposals, dependent: :nullify

    # Validations
    validates_presence_of \
      :title,
      :description,
      :event_id
    validates_numericality_of :duration, if: :duration

    def <=>(against)
      self.title <=> (against.nil? ? '' : against.title)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
open_conference_ware-1.0.0.pre4 app/models/open_conference_ware/session_type.rb
open_conference_ware-1.0.0.pre3 app/models/open_conference_ware/session_type.rb
open_conference_ware-1.0.0.pre2 app/models/open_conference_ware/session_type.rb
open_conference_ware-1.0.0.pre1 app/models/open_conference_ware/session_type.rb