Skip to content

Commit

Permalink
Merge pull request #5 from Beardev118/fix/to_s-8.0
Browse files Browse the repository at this point in the history
updated the factory for srid match
  • Loading branch information
Beardev118 committed Nov 30, 2023
2 parents 446a4a3 + 0301e1e commit 0d2d500
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/cases/basic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_set_point_wkt_wrong_type
def test_default_value
create_model
obj = SpatialModel.create
assert_equal factory.point(0, 0), obj.default_latlon
assert_equal factory(srid: 0).point(0, 0), obj.default_latlon
end

def test_custom_factory
Expand Down Expand Up @@ -215,7 +215,7 @@ def create_model
SpatialModel.connection.create_table(:spatial_models, force: true) do |t|
t.column "latlon", :st_point, srid: 3785
t.column "latlon_geo", :st_point, srid: 4326, geographic: true
t.column "default_latlon", :st_point, srid: 3785, default: "POINT(0.0 0.0)"
t.column "default_latlon", :st_point, srid: 0, default: "POINT(0.0 0.0)"
end
SpatialModel.reset_column_information
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def postgis_version
@postgis_version ||= SpatialModel.connection.select_value("SELECT postgis_lib_version()")
end

def factory
RGeo::Cartesian.preferred_factory(srid: 3785)
def factory(srid: 3785)
RGeo::Cartesian.preferred_factory(srid: srid)
end

def geographic_factory
Expand Down

0 comments on commit 0d2d500

Please sign in to comment.