mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
* Consistent route/model/controller/view layout * Get rid of unused photos, speakers, dietchoices, social_events controllers * Drop unused :public from Rooms and :description from CallForPapers
19 lines
384 B
Ruby
19 lines
384 B
Ruby
class Room < ActiveRecord::Base
|
|
attr_accessible :name, :size, :conference_id
|
|
|
|
belongs_to :conference
|
|
has_many :events
|
|
|
|
before_create :generate_guid
|
|
|
|
validates :name, presence: true
|
|
|
|
validates :size, numericality: { only_integer: true, greater_than: 0 }, allow_nil: true
|
|
|
|
private
|
|
|
|
def generate_guid
|
|
guid = SecureRandom.urlsafe_base64
|
|
self.guid = guid
|
|
end
|
|
end
|