Skip to content

Commit

Permalink
Don't delegate connection to self (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcelis authored Jun 5, 2024
1 parent c0a2669 commit 52da91b
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52da91b

Please sign in to comment.