-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Fix tests of #405 "Bump to 7.2.0" #412
Changes from all commits
35b0754
e4613dd
b14c665
f0ddf15
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,7 +6,7 @@ module PostGIS | |
class SchemaStatementsTest < ActiveSupport::TestCase | ||
def test_initialize_type_map | ||
SpatialModel.with_connection do |connection| | ||
assert connection.connected? | ||
connection.connect! | ||
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 guess the reasoning here is that 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. This was added in #397 , and there is a comment about it: https://github.com/rgeo/activerecord-postgis-adapter/pull/397/files#r1646652915 I think this line was added to highlight why the next command was failing, maybe to try pinpoint the reason the connection sometimes is not there. |
||
initialized_types = connection.send(:type_map).keys | ||
|
||
# PostGIS types must be initialized first, so | ||
|
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.
I'm not sure this is an ok behaviour in the lib (I mean if it is not clear when testing it, it may not be clear when using it), you've just work on it @formigarafa WDYT?
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.
I did not like that either but there is no other way to infer if there is a default set in the factory store.
From
rgeo-ativerecord
: https://github.com/rgeo/rgeo-activerecord/blob/master/lib/rgeo/active_record/spatial_factory_store.rb#L20-L22Maybe If this method used
||=
then it would work as the code seem to expect.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.
I'm unfortunately not sure it is that simple, for instance with
||=
you'd get a weird behaviour doing:both would be the same, ignoring
other_attr
.I opened an issue to see if there is a good way to refactor this rgeo/rgeo-activerecord#80