ankane/rollup

Rollup table per model.

Closed this issue · 1 comments

I wonder if there is a way to have different tables instead of store all rollups to one single table?

E.g.:

  • User rollups to table user_rollups
  • Order rollups to table order_rollups
  • etc.

like other gems do (mobility, statesman, closure_tree):

  • mobility: product_translations
  • statesman: user_transitions
  • closure_tree: organization_hierarchies
class User < ApplicationRecord
  self.rollup_table = :user_rollups
end

User::Rollup.series("New users", interval: "week")

Nice gem @ankane, congratulations!

Hi @phlegx, you could try forking and adding, but it's not something I'd like to support (don't want the additional complexity).