Created
August 8, 2018 03:25
-
-
Save siassaj/6c72830a16c989a3156eb9a9570a11db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_teams_and_departments_for_compare_time_series(teams, departments, company, minimum_employees) | |
team_names = teams ? teams : company.filled_teams(minimum_employees) | |
department_names = departments ? departments : company.filled_departments(minimum_employees) | |
combined = [team_names.map{|t| {t: t}}, department_names.map{|d| {d: d} }].zip.flatten.compact.first(4) | |
selected_teams = combined.select { |obj| obj.has_key? :t }.map { |obj| obj[:team] } | |
selected_departments = combined.select { |obj| obj.has_key? :d }.map { |obj| obj[:department] } | |
return selected_teams, selected_departments | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment