Sha256: 86776bc2db711a99df1745d2f38f5db477304b5f425865aebb67a6af2342dc41

Contents?: true

Size: 831 Bytes

Versions: 3

Compression:

Stored size: 831 Bytes

Contents

class BigbluebuttonMeeting < ActiveRecord::Base
  include ActiveModel::ForbiddenAttributesProtection

  belongs_to :server, :class_name => 'BigbluebuttonServer'
  belongs_to :room, :class_name => 'BigbluebuttonRoom'

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

  validates :room, :presence => true

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

  validates :start_time, :presence => true
  validates :start_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.user_attr_id)
      self.creator_id == userid
    else
      false
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bigbluebutton_rails-2.0.0 app/models/bigbluebutton_meeting.rb
bigbluebutton_rails-1.4.0 app/models/bigbluebutton_meeting.rb
bigbluebutton_rails-1.4.0.beta1 app/models/bigbluebutton_meeting.rb