From 1b20e2e06d949e1b310130acd5da56f6113bd947 Mon Sep 17 00:00:00 2001 From: George Gates Date: Sun, 8 Nov 2020 09:28:30 -0500 Subject: [PATCH 1/5] Update event_calendar.rb --- lib/event_calendar.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index d4fe85c..58926fe 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,7 +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( + self.all.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" @@ -188,4 +188,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) From b85a98bd7e3f597de65a9a31e69850eac077774e Mon Sep 17 00:00:00 2001 From: George Gates Date: Sun, 8 Nov 2020 10:01:43 -0500 Subject: [PATCH 2/5] Update event_calendar.rb --- lib/event_calendar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index 58926fe..a0018ba 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,7 +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.all.scoped(find_options).find( + self.all(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" From f7461c7e790962c8f5edbb354ee864f9c18019f0 Mon Sep 17 00:00:00 2001 From: George Gates Date: Sun, 8 Nov 2020 14:47:50 -0500 Subject: [PATCH 3/5] Update event_calendar.rb --- lib/event_calendar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index a0018ba..228d668 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,7 +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.all(find_options).find( + self.all.where(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" From 7d9e77c7a3a5f9fe8bbe17fa7a424eabc23cd265 Mon Sep 17 00:00:00 2001 From: George Gates Date: Sun, 8 Nov 2020 14:52:18 -0500 Subject: [PATCH 4/5] Update event_calendar.rb --- lib/event_calendar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index 228d668..6acca8c 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,7 +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.all.where(find_options).find( + self.where(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" From 08fcc62b65d86a788c6ec4ab41c697e39c0cf722 Mon Sep 17 00:00:00 2001 From: George Gates Date: Sun, 8 Nov 2020 14:58:50 -0500 Subject: [PATCH 5/5] Update event_calendar.rb --- lib/event_calendar.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/event_calendar.rb b/lib/event_calendar.rb index 6acca8c..16156f8 100644 --- a/lib/event_calendar.rb +++ b/lib/event_calendar.rb @@ -49,11 +49,11 @@ 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.where(find_options).find( - :all, + + self.where(find_options, :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" - ) + ).load end # Create the various strips that show events.