Sha256: 962f4a7936336f447f32f2b4bdd121d904bfdd77ae672133de1648879a399248

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

# coding: utf-8
class BigbluebuttonMeeting < ActiveRecord::Base
  include ActiveModel::ForbiddenAttributesProtection

  belongs_to :room, :class_name => 'BigbluebuttonRoom'

  has_one :recording,
          :class_name => 'BigbluebuttonRecording',
          :foreign_key => 'meeting_id',
          :dependent => :destroy

  has_many :attendees,
           :class_name => 'BigbluebuttonAttendee',
           :dependent => :destroy

  validates :room, :presence => true

  validates :meetingid, :presence => true, :length => { :minimum => 1, :maximum => 100 }

  validates :create_time, :presence => true
  validates :create_time, :uniqueness => { :scope => :room_id }

  # Whether the meeting was created by the `user` or not.
  def created_by?(user)
    unless user.nil?
      userid = user.send(BigbluebuttonRails.configuration.user_attr_id)
      self.creator_id == userid
    else
      false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bigbluebutton_rails-3.0.0 app/models/bigbluebutton_meeting.rb