-
Notifications
You must be signed in to change notification settings - Fork 21
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
Rails 7.2 support #31
base: main
Are you sure you want to change the base?
Changes from all commits
d15deb9
9adf0e5
a0cff2d
47118f2
0b40230
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,3 +1,3 @@ | ||
appraise "ar71" do | ||
gem "activerecord", "~> 7.1.0" | ||
appraise "ar72" do | ||
gem "activerecord", "~> 7.2.0" | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
module ActiveRecord | ||
module ConnectionAdapters | ||
module Mysql2Rgeo | ||
VERSION = "7.1.0" | ||
VERSION = "7.2.0" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ class Mysql2RgeoAdapter < Mysql2Adapter | |
# http://postgis.17.x6.nabble.com/Default-SRID-td5001115.html | ||
DEFAULT_SRID = 0 | ||
|
||
def initialize(connection, logger, connection_options, config) | ||
def initialize(...) | ||
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. Required by this change to ActiveRecord: https://github.com/rails/rails/pull/44591/files#diff-538a9bf3450c3aed556a0d2eacc26839a60becd744cda8c0a247dcb06aa0f02fR44 |
||
super | ||
|
||
@visitor = Arel::Visitors::Mysql2Rgeo.new(self) | ||
|
@@ -137,6 +137,10 @@ def quote(value) | |
end | ||
end | ||
|
||
def with_connection | ||
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. Required by this change to ActiveRecord: https://github.com/rails/rails/pull/51162/files#diff-22750093c2231cef8c58e7e94a0a9266267d33bd990c607475e55fe285fccb8aR45 I only saw this |
||
yield self | ||
end | ||
|
||
private | ||
def type_map | ||
emulate_booleans ? TYPE_MAP_WITH_BOOLEAN : TYPE_MAP | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_record/connection_adapters/mysql2rgeo_adapter" | ||
|
||
ActiveRecord::ConnectionAdapters.register('mysql2rgeo', 'ActiveRecord::ConnectionAdapters::Mysql2RgeoAdapter', 'active_record/connection_adapters/mysql2rgeo_adapter') | ||
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. Fixes the following error when running
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ def test_point_to_json | |
obj = SpatialModel.new | ||
assert_match(/"latlon":null/, obj.to_json) | ||
obj.latlon = factory.point(1.0, 2.0) | ||
assert_match(/"latlon":"POINT\s\(1\.0\s2\.0\)"/, obj.to_json) | ||
assert_match(/"latlon":"POINT\s\(1(\.0)?\s2(\.0)?\)"/, obj.to_json) | ||
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. Fixes this test failure:
I didn't research what caused the change with this decimal formatting |
||
end | ||
|
||
def test_custom_column | ||
|
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.
Required by this change to ActiveRecord: https://github.com/rails/rails/pull/46178/files#diff-fac852e063eee718c2af44dec6f80b1b46f52f8aae7936e5eea6b2eab08cf2f7R590