Module: HasActivity::ActivitizeCalculations::OverallMethods

Defined in:
lib/has_activity/activitize_calculations.rb

Instance Method Summary collapse

Instance Method Details

#activity_between(between_start, between_end, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/has_activity/activitize_calculations.rb', line 10

def activity_between(between_start, between_end, options={})
  # Normalize dates...
  start_and_end = [between_start.to_time, between_end.to_time]
  if between_start > between_end
    start_and_end = start_and_end.reverse
  end
  calculate_activity(*start_and_end, options.merge(:between => true))
end

#activity_since(since, options = {}) ⇒ Object



19
20
21
# File 'lib/has_activity/activitize_calculations.rb', line 19

def activity_since(since, options={})
  calculate_activity(since.to_time, Time.now, options)
end