one meeting per room

This commit is contained in:
Josh
2018-05-14 14:28:18 -04:00
parent 0f8a4734b2
commit 1ddc3172eb
13 changed files with 126 additions and 149 deletions

View File

@ -3,9 +3,10 @@ class Room < ApplicationRecord
before_create :set_uid
belongs_to :user
has_many :meetings
has_one :meeting
def owned_by?(user)
return false if user.nil?
user.room == self
end