class RevenueStat
DEFAULT_RANGE = 30.days
def initialize(account, range: DEFAULT_RANGE)
@account = account
@range = range
class InvoicesController < ApplicationController
def index
invoices = InvoicesQuery.new(current_account.invoices, filter_params).call
@invoices = invoices.page(params[:page]).per(25)
render :index
class Article < ApplicationRecord
has_many :taggings, dependent: :destroy
has_many :tags, through: :taggings
scope :published, -> { where.not(published_at: nil) }