Sha256: a662fde3a811045faf603718230d6d240aacbc1209b00b4121100924779f75a2

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

class PostReport < Repor::Report
  report_on :Post
  count_aggregator :count
  sum_aggregator :total_likes, expression: 'posts.likes'
  min_aggregator :min_likes, expression: 'posts.likes'
  min_aggregator :min_created_at, expression: 'posts.created_at'
  max_aggregator :max_likes, expression: 'posts.likes'
  max_aggregator :max_created_at, expression: 'posts.created_at'
  avg_aggregator :avg_likes, expression: 'posts.likes'
  array_aggregator :post_ids, expression: 'posts.id'
  category_dimension :author, expression: 'authors.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

1 entries across 1 versions & 1 rubygems

Version Path
repor-0.1.0 spec/dummy/app/models/post_report.rb