Class: Decidim::Comments::Metrics::CommentParticipantsMetricMeasure
- Inherits:
-
MetricMeasure
- Object
- MetricMeasure
- Decidim::Comments::Metrics::CommentParticipantsMetricMeasure
- Defined in:
- decidim-comments/app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb
Overview
Searches for Participants in the following actions
- Leave a comment (Comments)
Instance Method Summary collapse
Methods inherited from MetricMeasure
Constructor Details
This class inherits a constructor from Decidim::MetricMeasure
Instance Method Details
#calculate ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'decidim-comments/app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb', line 13 def calculate cumulative_users = [] quantity_users = [] retrieve_comments_for_organization.each do |comment| = comment.root_commentable next unless next unless check_participatory_space(@resource, ) cumulative_users << comment. quantity_users << comment. if comment.created_at >= start_time end { cumulative_users: cumulative_users.uniq, quantity_users: quantity_users.uniq } end |
#valid? ⇒ Boolean
9 10 11 |
# File 'decidim-comments/app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb', line 9 def valid? super && @resource.is_a?(Decidim::Participable) end |