Class: ProductAnalyticsEvent

Inherits:
ApplicationRecord show all
Defined in:
app/models/product_analytics_event.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.count_by_graph(graph, days) ⇒ Object


25
26
27
# File 'app/models/product_analytics_event.rb', line 25

def self.count_by_graph(graph, days)
  group(graph).timerange(days).count
end

Instance Method Details

#as_json_wo_emptyObject


29
30
31
# File 'app/models/product_analytics_event.rb', line 29

def as_json_wo_empty
  as_json.compact
end