lib/vanilla.rb in by_star-0.3.0 vs lib/vanilla.rb in by_star-0.3.1
- old
+ new
@@ -196,11 +196,13 @@
def by_star(start_time, end_time, options = {}, &block)
start_time = parse(start_time)
end_time = parse(end_time)
raise ParseError, "End time is before start time, searching like this will return no results." if end_time < start_time
-
- with_scope(:find => { :conditions => conditions_for_range(start_time, end_time, options) }) do
+ order = options.delete(:order)
+ scoping = { :conditions => conditions_for_range(start_time, end_time, options) }
+ scoping.merge!(:order => order) if order
+ with_scope(:find => scoping) do
if block_given?
with_scope(:find => block.call) do
find(:all)
end
else
\ No newline at end of file