Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't delegate connection to self #436

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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