Sha256: f6490112ddd60f9b466b9c934eb7d2cbec8d785791682f7b4c97caf4c0c8f63e
Contents?: true
Size: 584 Bytes
Versions: 24
Compression:
Stored size: 584 Bytes
Contents
module Workarea module Admin class CodeListViewModel < ApplicationViewModel def promo_codes @promo_codes ||= model.promo_codes.page(options[:page]) end def unused_promo_codes @unused_promo_codes ||= model.promo_codes.unused.to_a end def used_count model.promo_codes.count - unused_promo_codes.count end def last_used_at @last_used_at ||= model.promo_codes.order(used_at: :desc).first.used_at end def timeline @timeline ||= TimelineViewModel.new(model) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems