Sha256: 127efd3db5f94aea93de2154b15a75e7d0315c0560a1433decc57068ef78525f
Contents?: true
Size: 1.23 KB
Versions: 3
Compression:
Stored size: 1.23 KB
Contents
module Spree class Report class TimedResult < Result def build_report_observations query_results build_empty_observations populate_observations end def build_empty_observations @observations = Spree::Report::DateSlicer.slice_into(start_date, end_date, time_scale, self.class::Observation) end def populate_observations observation_iter = @observations.each current_observation = @observations.present? ? observation_iter.next : nil @results.each do |result| if current_observation.present? begin until current_observation.describes? result, time_scale current_observation = observation_iter.next end current_observation.populate(result) current_observation = observation_iter.next rescue StopIteration break end end end end def headers [time_headers] + super end private def time_headers { name: Spree.t(time_dimension, scope: [:admin]), value: time_dimension, type: :string, sortable: false } end end end end
Version data entries
3 entries across 3 versions & 2 rubygems