improved options passed into Finder object, :depth option is not needed if :interval is set to a depth value instead of true

This commit is contained in:
2011-03-13 19:51:04 +00:00
parent 108b6ab02e
commit acedf071d1
2 changed files with 6 additions and 0 deletions

View File

@@ -9,6 +9,10 @@ module Redistat
end
def find_date_sets(start_date, end_date, depth = nil, interval = false)
if depth.nil? && interval.is_a?(Symbol)
depth = interval
interval = true
end
start_date = start_date.to_time if start_date.is_a?(::Date)
end_date = end_date.to_time if end_date.is_a?(::Date)
if !interval