Sha256: 3120fa1ee5fad240f61dc1af91f9a34d47a036b0a3e58cc6852d8a21bc2a43bd

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

module OpenConferenceWare

  # == Schema Information
  #
  # Table name: rooms
  #
  #  id                    :integer          not null, primary key
  #  name                  :string(255)      not null
  #  capacity              :integer
  #  size                  :string(255)
  #  seating_configuration :string(255)
  #  description           :text
  #  event_id              :integer
  #  created_at            :datetime
  #  updated_at            :datetime
  #  image_file_name       :string(255)
  #  image_content_type    :string(255)
  #  image_file_size       :integer
  #  image_updated_at      :datetime
  #

  class Room < OpenConferenceWare::Base
    # Associations
    belongs_to :event
    has_many :proposals, dependent: :nullify
    has_many :schedule_items, dependent: :nullify

    # Validations
    validates_presence_of :name, :event
    validates_numericality_of :capacity, unless: lambda{|obj| obj.capacity.blank? }

    # Image Attachment
    has_attached_file :image,
      path: ":rails_root/public/system/:attachment/:id/:style/:filename",
      url: "/system/:attachment/:id/:style/:filename",
      styles: {
        large: "650>",
        medium: "350>",
        small: "150>"
      }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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