diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index d4fe85c..5db1de6 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,11 +49,7 @@ def get_start_and_end_dates(shown_date, first_day_of_week=0) # Get the events overlapping the given start and end dates def events_for_date_range(start_d, end_d, find_options = {}) - self.scoped(find_options).find( - :all, - :conditions => [ "(? <= #{self.quoted_table_name}.#{self.end_at_field}) AND (#{self.quoted_table_name}.#{self.start_at_field}< ?)", start_d.to_time.utc, end_d.to_time.utc ], - :order => "#{self.quoted_table_name}.#{self.start_at_field} ASC" - ) + self.where("(? <= #{self.end_at_field}) AND (#{self.start_at_field}< ?)", start_d.to_time.utc, end_d.to_time.utc ).order("#{self.start_at_field} ASC") end # Create the various strips that show events. @@ -188,4 +184,4 @@ def adjust_all_day_dates end end -require 'event_calendar/railtie' if defined?(::Rails::Railtie) \ No newline at end of file +require 'event_calendar/railtie' if defined?(::Rails::Railtie)