-
Notifications
You must be signed in to change notification settings - Fork 7
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
39 legacy connection handler #40
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Gem::Specification.new do |s| | ||
s.name = 'grape-app' | ||
s.version = '0.11.1' | ||
s.version = '0.11.2' | ||
s.authors = ['Black Square Media Ltd'] | ||
s.email = ['[email protected]'] | ||
s.summary = %(Standalone Grape API apps) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
ActiveSupport::KeyGenerator.hash_digest_class = OpenSSL::Digest::SHA256 if ActiveSupport::KeyGenerator.respond_to?(:hash_digest_class=) | ||
ActiveSupport::MessageEncryptor.use_authenticated_message_encryption = true | ||
ActiveSupport::IsolatedExecutionState.isolation_level = :thread if defined?(ActiveSupport::IsolatedExecutionState) | ||
# This is legacy and removed in removed with Rails 7.1 | ||
Digest::UUID.use_rfc4122_namespaced_uuids = true if Digest::UUID.respond_to?(:use_rfc4122_namespaced_uuids=) | ||
|
||
# Set default time-zone | ||
|
@@ -43,10 +44,13 @@ def call(exception, *) | |
ActiveRecord::Base.default_timezone = :utc | ||
end | ||
|
||
if ActiveRecord.respond_to?(:legacy_connection_handling=) | ||
ActiveRecord.legacy_connection_handling = false | ||
else | ||
ActiveRecord::Base.legacy_connection_handling = false | ||
# legacy_connection_handling was deprecated in ActiveRecord 7 | ||
if ActiveRecord::VERSION::MAJOR < 7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it's still in the code. So |
||
if ActiveRecord.respond_to?(:legacy_connection_handling=) | ||
ActiveRecord.legacy_connection_handling = false | ||
else | ||
ActiveRecord::Base.legacy_connection_handling = false | ||
end | ||
end | ||
|
||
ActiveRecord.tap do |c| | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be an
elsif
. same here, we should support versions older than7.1