Skip to content

Commit

Permalink
Fixed chart data serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Tsoganov authored and Sergei Tsoganov committed Dec 7, 2022
1 parent e70be80 commit 7c84949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/repp/v1/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def group(domains)
def registrar_names
@registrar_names ||= ::Registrar.where(test_registrar: false)
.map { |r| { "#{r.id}": r.name }.with_indifferent_access }
.inject(:merge)
.reduce({}, :merge)
end

def serialize_distribution_result(result)
Expand All @@ -122,7 +122,7 @@ def serialize_distribution_result(result)
hash = { name: name, y: value }
hash.merge!({ sliced: true, selected: true }) if current_user.registrar.name == name
hash
end
end.compact
end

def serialize_growth_rate_result(result)
Expand All @@ -131,7 +131,7 @@ def serialize_growth_rate_result(result)

name = registrar_names[key]
[name, value]
end
end.compact
end
end
end
Expand Down

0 comments on commit 7c84949

Please sign in to comment.