Skip to content

Commit 435027d

Browse files
committed
cleanup
1 parent ac74f4e commit 435027d

File tree

7 files changed

+7
-49
lines changed

7 files changed

+7
-49
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Run Tests
7070
run: bundle exec rake test
7171
env:
72-
PGHOST: 127.0.0.1
72+
PGHOST: localhost
7373
PGUSER: postgres
7474
PGPASSWORD: postgres
7575
TESTOPTS: --profile=3

Gemfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ gemspec
55

66
gem "pg", "~> 1.0", platform: :ruby
77
gem "byebug" if ENV["BYEBUG"]
8-
gem "tracer"
98

109
def activerecord_version
1110
return ENV["AR_VERSION"] if ENV["AR_VERSION"]
@@ -33,14 +32,8 @@ end
3332
gem "rails", github: "rails/rails", tag: "v#{activerecord_version}"
3433

3534
group :development do
36-
gem "minitest-excludes", "~> 2.0"
37-
3835
# Gems used by the ActiveRecord test suite
3936
gem "bcrypt"
4037
gem "sqlite3"
4138
gem "msgpack"
42-
43-
# Still used a little bit in our tests.
44-
# TODO: get rid of the dependency
45-
gem "mocha"
4639
end

activerecord-postgis-adapter.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ Gem::Specification.new do |spec|
1717
spec.files = Dir["lib/**/*", "LICENSE.txt"]
1818
spec.platform = Gem::Platform::RUBY
1919

20-
# # ruby-lang.org/en/downloads/branches
20+
# ruby-lang.org/en/downloads/branches
2121
spec.required_ruby_version = ">= 3.1.0"
2222

2323
spec.add_dependency "activerecord", "~> 7.2.0"
2424
spec.add_dependency "rgeo-activerecord", "~> 8.0.0"
2525

2626
spec.add_development_dependency "rake", "~> 13.0"
2727
spec.add_development_dependency "minitest", "~> 5.4"
28+
spec.add_development_dependency "minitest-excludes", "~> 2.0"
2829
spec.add_development_dependency "benchmark-ips", "~> 2.12"
2930
spec.add_development_dependency "rubocop", "~> 1.50"
3031

3132
spec.metadata = {
33+
"funding_uri" => "https://opencollective.com/rgeo",
3234
"rubygems_mfa_required" => "true"
3335
}
3436
end

lib/active_record/connection_adapters/postgis/oid/spatial.rb

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,10 @@ def self.parse_sql_type(sql_type)
5353
end
5454

5555
def spatial_factory
56-
return @spatial_factory if defined?(@spatial_factory)
57-
@spatial_factory =
56+
@spatial_factory ||=
5857
RGeo::ActiveRecord::SpatialFactoryStore.instance.factory(
5958
factory_attrs
6059
)
61-
62-
if @srid != @spatial_factory.srid
63-
puts
64-
puts "INITIALIZATION ERROR"
65-
puts
66-
end
67-
68-
# Tracer is waaay too noisy
69-
# require "tracer"
70-
# Tracer.trace(@spatial_factory)
71-
@spatial_factory
7260
end
7361

7462
def spatial?
@@ -83,18 +71,6 @@ def type
8371
def serialize(value)
8472
return if value.nil?
8573
geo_value = cast_value(value)
86-
if spatial_factory.srid != @srid
87-
$something_wrong = true
88-
puts ?* * 100
89-
puts "@geo_type: #{@geo_type}"
90-
puts "type.to_s: #{type.to_s}"
91-
puts "@srid: #{@srid}"
92-
p spatial_factory # It has srid=0 when bugged
93-
p value
94-
p geo_value
95-
puts
96-
puts
97-
end
9874

9975
# TODO - only valid types should be allowed
10076
# e.g. linestring is not valid for point column

test/cases/ddl_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_no_query_spatial_column_info
285285

286286
# `SpatialColumnInfo#all` queries column info from the database.
287287
# It should not be called when klass.columns is called
288-
assert_queries_count(0) do
288+
assert_no_queries do
289289
# first column is id, second is name
290290
refute klass.columns[1].spatial?
291291
assert_nil klass.columns[1].has_z

test/rake_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def activerecord_test_files
2929
.map { |file| File.join ar_root, file.strip }
3030
.sort
3131
.prepend(POSTGIS_TEST_HELPER)
32-
.then{ FileList[*_1] }
32+
.then { FileList[*_1] }
3333
else
3434
FileList["#{ar_root}/test/cases/**/*_test.rb"]
3535
.reject { _1.include?("/adapters/") || _1.include?("/encryption/performance") }

test/test_helper.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,10 @@ def time_it
8282
end
8383
end
8484

85-
$something_wrong = false
86-
$last_test = nil
8785
module ActiveSupport
8886
class TestCase
8987
include TestTimeoutHelper
9088

91-
teardown do
92-
if $something_wrong
93-
puts
94-
puts "SOMETHING WRONG in test #{name.inspect}"
95-
puts "ran after #{$last_test.inspect}"
96-
puts
97-
$something_wrong = false
98-
end
99-
$last_test = name
100-
end
101-
10289
def factory(srid: 3785)
10390
RGeo::Cartesian.preferred_factory(srid: srid)
10491
end

0 commit comments

Comments
 (0)