Class: Workarea::Admin::Insights::DiscountViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Admin::Insights::DiscountViewModel
show all
- Includes:
- InsightsDetails
- Defined in:
- app/view_models/workarea/admin/insights/discount_view_model.rb
Instance Method Summary
collapse
#current_period, #ends_at, #previous_ends_at, #previous_period, #previous_starts_at, #starts_at
Instance Method Details
#feed ⇒ Object
13
14
15
16
17
|
# File 'app/view_models/workarea/admin/insights/discount_view_model.rb', line 13
def feed
@feed ||= InsightViewModel.wrap(
Workarea::Insights::Base.by_discount(model.id).to_a
)
end
|
#top? ⇒ Boolean
19
20
21
|
# File 'app/view_models/workarea/admin/insights/discount_view_model.rb', line 19
def top?
Workarea::Insights::TopDiscounts.current.include?(discount_id: model.id)
end
|