You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/models/teacher_course_group.rb

16 lines
413 B

6 years ago
class TeacherCourseGroup < ApplicationRecord
belongs_to :course_group
belongs_to :course, optional: true
belongs_to :user
belongs_to :course_member, optional: true
scope :find_teacher_group_ids, lambda { |ids| where(course_group_id: ids) unless ids.blank?}
scope :get_user_groups,lambda {|ids| where(user_id:ids)}
def course_members
self.course_group.course_members
end
end