-
-
Notifications
You must be signed in to change notification settings - Fork 257
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 1 commit
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" | ||
|
||
|
|
||
| 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 | ||
|
||
| if sql_type.nil? | ||
| return [nil, 0, false, false, false] | ||
| end | ||
|
|
||
| geo_type = nil | ||
| srid = 0 | ||
| has_z = false | ||
|
|
@@ -53,10 +59,16 @@ def self.parse_sql_type(sql_type) | |
| end | ||
|
|
||
| def spatial_factory | ||
| @spatial_factory ||= | ||
| if frozen? | ||
|
||
| RGeo::ActiveRecord::SpatialFactoryStore.instance.factory( | ||
| factory_attrs | ||
| ) | ||
| else | ||
| @spatial_factory ||= | ||
| RGeo::ActiveRecord::SpatialFactoryStore.instance.factory( | ||
| factory_attrs | ||
| ) | ||
| end | ||
| end | ||
|
|
||
| def spatial? | ||
|
|
||
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.