Sha256: 90d2075b6c112a7a61074bb23a34b7330066873833a57688decab3ed0dc29a2e
Contents?: true
Size: 867 Bytes
Versions: 6
Compression:
Stored size: 867 Bytes
Contents
class Mite::TimeEntryGroup < Mite::Base self.collection_name = "time_entries" attr_accessor :time_entries_params class << self def find_every(options={}) return Mite::TimeEntry.all(options) if !options[:params] || !options[:params][:group_by] super(options).each do |record| if record.attributes["time_entries_params"] record.time_entries_params = record.attributes.delete("time_entries_params").attributes.stringify_keys end end end end def time_entries(options={}) return [] unless time_entries_params.is_a?(Hash) empty_result = false options[:params] ||= {} options[:params].stringify_keys! options[:params].merge!(time_entries_params) do |key, v1, v2| empty_result = (v1 != v2) v2 end return [] if empty_result Mite::TimeEntry.all(options) end end
Version data entries
6 entries across 6 versions & 1 rubygems