SIGS/lib/modules/user_module.rb
def school_rooms_by_user
  if permission[:level] == 1
    department_disciplines = current_user.coordinator.course.department.disciplines
    department_school_rooms = []
    department_disciplines.each do |discipline|
      department_school_rooms += discipline.school_rooms
    end
    return department_school_rooms
  else
    return SchoolRoom.all
  end
end
# this method retrieves the number of school rooms per user
this method retrieves the number of school rooms per user
this method retrieves the number of school rooms per user
def school_rooms_by_user
  if permission[:level] == 1
    department_disciplines = current_user.coordinator.course.department.disciplines
    department_school_rooms = []
    department_disciplines.each do |discipline|
      department_school_rooms += discipline.school_rooms
    end
    return department_school_rooms
  else
    return SchoolRoom.all
  end
end
def school_rooms_by_user if permission [ :level ] == 1 department_disciplines = current_user . coordinator . course . department . disciplines department_school_rooms = [ ] department_disciplines . each do | discipline | department_school_rooms += discipline . school_rooms end return department_school_rooms else return SchoolRoom . all end end
this method retrieves the number of school rooms per user
this method retrieves the number of school rooms per user