class StudentMembership

Constants

STATUSES

Public Instance Methods

inviter?() click to toggle source
# File app/models/student_membership.rb, line 38
def inviter?
  membership_status == 'inviter'
end
must_be_valid_student() click to toggle source
# File app/models/student_membership.rb, line 27
def must_be_valid_student
  if user && !user.is_a?(Student)
    errors.add('base', 'User must be a student')
    return false
  end
  unless STATUSES.values.include?(membership_status)
    errors.add('base', 'Invalid membership status')
    false
  end
end