-
-
Notifications
You must be signed in to change notification settings - Fork 258
Compatibility with Rails 8.1 #435
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
Changes from 4 commits
6b0af9e
0710889
b0041ea
4a4faf5
365c2ff
de40243
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 |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ gemspec | |
| gem "pg", "~> 1.0", platform: :ruby | ||
| gem "byebug" if ENV["BYEBUG"] | ||
|
|
||
| gem "rgeo-activerecord", git: "https://github.com/rgeo/rgeo-activerecord.git" | ||
|
Contributor
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. interesting! Do rgeo need any release ?
Contributor
Author
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. Yes, I had a PR for 8.1 support merged a few weeks ago..
Member
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. On it now ! Thank you for the PR |
||
|
|
||
| def activerecord_version | ||
| return ENV["AR_VERSION"] if ENV["AR_VERSION"] | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ module OID | |
| # Responsible for parsing sql_types returned from the database and WKT features. | ||
| class Spatial < Type::Value | ||
| def initialize(geo_type: "geometry", srid: 0, has_z: false, has_m: false, geographic: false) | ||
| super() | ||
| @geo_type = geo_type | ||
| @srid = srid | ||
| @has_z = has_z | ||
|
|
@@ -25,6 +26,11 @@ def initialize(geo_type: "geometry", srid: 0, has_z: false, has_m: false, geogra | |
| # has_z: false | ||
| # has_m: false | ||
| def self.parse_sql_type(sql_type) | ||
| # Could be nil during type registration | ||
|
Contributor
Author
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. Not entirely sure why this happens as I'm not fully familiar with active record internals, but this seems to work.
Member
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. I'm investigating it these days on crdb adapter, I hope I'll come with more information and a clean solution soonish :) (before the end of this month) |
||
| if sql_type.nil? | ||
| return [nil, 0, false, false, false] | ||
| end | ||
|
|
||
| geo_type = nil | ||
| srid = 0 | ||
| has_z = false | ||
|
|
@@ -53,10 +59,9 @@ def self.parse_sql_type(sql_type) | |
| end | ||
|
|
||
| def spatial_factory | ||
| @spatial_factory ||= | ||
| RGeo::ActiveRecord::SpatialFactoryStore.instance.factory( | ||
| factory_attrs | ||
| ) | ||
| RGeo::ActiveRecord::SpatialFactoryStore.instance.factory( | ||
| factory_attrs | ||
| ) | ||
| end | ||
|
|
||
| def spatial? | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require_relative "fix_backtrace_cleaner" | ||
| include(FixBacktraceCleaner) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require_relative "fix_backtrace_cleaner" | ||
| include(FixBacktraceCleaner) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require_relative "fix_backtrace_cleaner" | ||
| include(FixBacktraceCleaner) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require_relative "fix_backtrace_cleaner" | ||
| include(FixBacktraceCleaner) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require_relative "fix_backtrace_cleaner" | ||
| include(FixBacktraceCleaner) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| module FixBacktraceCleaner | ||
| def setup | ||
| super | ||
| bc = ActiveSupport::BacktraceCleaner.new | ||
| bc.remove_silencers! | ||
| bc.remove_filters! | ||
| bc.add_silencer { !_1.include?(::AssociationDeprecationTest::TestCase::THIS_FILE) } | ||
| ActiveRecord::LogSubscriber.backtrace_cleaner = bc | ||
| end | ||
| end |
Uh oh!
There was an error while loading. Please reload this page.
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.
pg 18 was released a month ago is there a reason not to include it here?my fault, this pr went up before it came out. still might be nice to add here though.