Skip to content

Commit

Permalink
Merge pull request #586 from transitland/operator-aggregate-additions
Browse files Browse the repository at this point in the history
Operator aggregate: add name and short_name
  • Loading branch information
irees committed May 9, 2016
2 parents 46ae34e + af9bc0c commit 6c58e28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/api/v1/operators_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,16 @@ def aggregate
state: {},
metro: {},
timezone: {},
name: {},
short_name: {},
tags: {}
}
json[:country] = count_values(Operator.pluck(:country), attr_name: :country)
json[:state] = count_values(Operator.pluck(:state), attr_name: :state)
json[:metro] = count_values(Operator.pluck(:metro), attr_name: :metro)
json[:timezone] = count_values(Operator.pluck(:timezone), attr_name: :timezone)
json[:name] = count_values(Operator.pluck(:name), attr_name: :name)
json[:short_name] = count_values(Operator.pluck(:short_name), attr_name: :short_name)
json[:tags] = count_and_gather_values(Operator.pluck(:tags))
json
end
Expand Down

0 comments on commit 6c58e28

Please sign in to comment.