17 lines
373 B
Ruby
17 lines
373 B
Ruby
module JamRuby
|
|
class JamSession < ActiveRecord::Base
|
|
|
|
set_primary_key :id
|
|
belongs_to :user, :inverse_of => :jam_sessions
|
|
|
|
has_many :jam_session_members
|
|
has_many :users, :through => :jam_session_members
|
|
|
|
# Verifies that the specified user can join this jam session
|
|
def access?(user)
|
|
return self.users.exists? user
|
|
end
|
|
|
|
end
|
|
end
|