Table name: groups
id :integer not null, primary key name :string(255) description :text university_id :integer resource_id :integer resource_type :string(255)
Returns true if resource type is not user
# File app/models/group.rb, line 52 def automated_group? !user_group? end
Returns true if resource type is course
# File app/models/group.rb, line 66 def tutorable? resource_type == 'Course' end
Returns tutors
# File app/models/group.rb, line 57 def tutors if tutorable? resource.tutors else super end end
Trigger background job to create/update groups
# File app/models/group.rb, line 71 def trigger_pusher_group_event CreateOrUpdateGroups.perform_async(id) end
Returns true if resource type is user
# File app/models/group.rb, line 47 def user_group? resource_type == 'User' end
Convert comma separated user ids string into array format.
# File app/models/group.rb, line 41 def user_ids=(ids) ids = ids.split(',') if ids.is_a? String super(ids) end