osem-fcy/app/models/room.rb

19 lines
358 B
Ruby
Raw Normal View History

2013-01-07 09:04:09 +01:00
class Room < ActiveRecord::Base
attr_accessible :name, :size, :public
belongs_to :conference
has_many :events
before_create :generate_guid
private
def generate_guid
2014-06-23 19:07:50 +03:00
guid = SecureRandom.urlsafe_base64
# begin
# guid = SecureRandom.urlsafe_base64
# end while Person.where(:guid => guid).exists?
2013-01-07 09:04:09 +01:00
self.guid = guid
end
end