Module: ActiveWarehouse::SlowlyChangingDimension::InstanceMethods::ClassMethods

Defined in:
lib/active_warehouse/dimension/slowly_changing_dimension.rb

Instance Method Summary collapse

Instance Method Details

#calculate(*args) ⇒ Object



99
100
101
# File 'lib/active_warehouse/dimension/slowly_changing_dimension.rb', line 99

def calculate(*args)
  with_older_scope { calculate_with_older(*args) }
end

#count(*args) ⇒ Object



95
96
97
# File 'lib/active_warehouse/dimension/slowly_changing_dimension.rb', line 95

def count(*args)
  with_older_scope { count_with_older(*args) }
end

#count_with_older(*args) ⇒ Object



91
92
93
# File 'lib/active_warehouse/dimension/slowly_changing_dimension.rb', line 91

def count_with_older(*args)
  calculate_with_older(:count, *construct_count_options_from_legacy_args(*args))
end

#find_with_older(*args) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/active_warehouse/dimension/slowly_changing_dimension.rb', line 78

def find_with_older(*args)
  options = extract_options_from_args!(args)
  validate_find_options(options)
  set_readonly_option!(options)
  options[:with_older] = true # yuck!

  case args.first
    when :first then find_initial(options)
    when :all   then find_every(options)
    else             find_from_ids(args, options)
  end
end