diff options
author | James Lopez <james@jameslopez.es> | 2016-11-22 13:46:02 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-17 13:32:54 +0300 |
commit | fc6f8f20562ad761c034ffff076d329a3e9e8f4d (patch) | |
tree | 401c48a79209f656fa74dffe102d4385caefea76 /app/serializers | |
parent | dc6ea14b0d11a5e73e81c95ef723f0c1af69215b (diff) |
added new summary serializers and refactor all of the summary stuff into separate logical classes
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/analytics_summary_entity.rb | 7 | ||||
-rw-r--r-- | app/serializers/analytics_summary_serializer.rb | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/serializers/analytics_summary_entity.rb b/app/serializers/analytics_summary_entity.rb new file mode 100644 index 00000000000..91803ec07f5 --- /dev/null +++ b/app/serializers/analytics_summary_entity.rb @@ -0,0 +1,7 @@ +class AnalyticsSummaryEntity < Grape::Entity + expose :value, safe: true + + expose :title do |object| + object.title.pluralize(object.value) + end +end diff --git a/app/serializers/analytics_summary_serializer.rb b/app/serializers/analytics_summary_serializer.rb new file mode 100644 index 00000000000..c87a24aa47c --- /dev/null +++ b/app/serializers/analytics_summary_serializer.rb @@ -0,0 +1,3 @@ +class AnalyticsSummarySerializer < BaseSerializer + entity AnalyticsSummaryEntity +end |