Sha256: c129af0f3d27fb261bb4e45a5cb265e427db49e814b4982f55f9a10c56ef343c

Contents?: true

Size: 650 Bytes

Versions: 10

Compression:

Stored size: 650 Bytes

Contents

class PostReport < ActiveReporter::Report
  report_on :post
  count_aggregator :count
  sum_aggregator :total_likes, attribute: :likes
  min_aggregator :min_likes, attribute: :likes
  min_aggregator :min_created_at, attribute: :created_at
  max_aggregator :max_likes, attribute: :likes
  max_aggregator :max_created_at, attribute: :created_at
  average_aggregator :avg_likes, attribute: :likes
  array_aggregator :post_ids, attribute: :id
  category_dimension :author, model: :authors, attribute: :name, relation: ->(r) { r.joins('LEFT OUTER JOIN authors ON authors.id = posts.author_id') }
  number_dimension :likes
  time_dimension :created_at
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active_reporter-0.6.3 spec/dummy/app/models/post_report.rb
active_reporter-0.6.2 spec/dummy/app/models/post_report.rb
active_reporter-0.6.1 spec/dummy/app/models/post_report.rb
active_reporter-0.6.0 spec/dummy/app/models/post_report.rb
active_reporter-0.5.13 spec/dummy/app/models/post_report.rb
active_reporter-0.5.12 spec/dummy/app/models/post_report.rb
active_reporter-0.5.11 spec/dummy/app/models/post_report.rb
active_reporter-0.5.10 spec/dummy/app/models/post_report.rb
active_reporter-0.5.9 spec/dummy/app/models/post_report.rb
active_reporter-0.5.8 spec/dummy/app/models/post_report.rb