From 52da91b7d62b4fc9c4b4ddffd947004d94fefea9 Mon Sep 17 00:00:00 2001 From: David Celis Date: Wed, 5 Jun 2024 12:52:38 -0700 Subject: [PATCH] Don't delegate `connection` to `self` (#436) --- .../acts/position_column_method_definer.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/acts_as_list/active_record/acts/position_column_method_definer.rb b/lib/acts_as_list/active_record/acts/position_column_method_definer.rb index 78c52b87..26c85d9b 100644 --- a/lib/acts_as_list/active_record/acts/position_column_method_definer.rb +++ b/lib/acts_as_list/active_record/acts/position_column_method_definer.rb @@ -72,17 +72,18 @@ def self.define_instance_methods(caller_class, position_column) cached_quoted_now = quoted_current_time_from_proper_timezone timestamp_attributes_for_update_in_model.map do |attr| - ", #{connection.quote_column_name(attr)} = #{cached_quoted_now}" + ", #{self.class.connection.quote_column_name(attr)} = #{cached_quoted_now}" end.join end private - delegate :connection, to: self - def quoted_current_time_from_proper_timezone - connection.quote(connection.quoted_date( - current_time_from_proper_timezone)) + self.class.connection.quote( + self.class.connection.quoted_date( + current_time_from_proper_timezone + ) + ) end end end