iron_trail 0.2.2 → 0.3.0.pre.alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/iron_trail/testing/rspec.rb +16 -2
- data/lib/iron_trail/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f71f8c85d8b8b0bb81528cba7696a279cd012a85035f4882f61607a4f032778
|
|
4
|
+
data.tar.gz: b9aaf678019f278724a510cfd6df566288976939dda0f5f37aa67b01538a9ab4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56f449260f7c0f83cde52d4311e370828bf2a4d0250f6490003de296066e2717f56afebc969dfe97d74fba2ecefd1a43d72236bdc32450ce7384f1e3b8fc9a56
|
|
7
|
+
data.tar.gz: 1b3ce44bad0e293d3c6eb38e21d1d076713ff53240bce114bcb5504f74457db94dc4978cfacb8d182ec590ae08aa5d67008d2e06a923bf8ae17aacaa05053fec
|
|
@@ -27,7 +27,7 @@ module IronTrail
|
|
|
27
27
|
attr_accessor :enabled
|
|
28
28
|
|
|
29
29
|
def enable!
|
|
30
|
-
DbFunctions.new(
|
|
30
|
+
with_connection { |conn| DbFunctions.new(conn).install_functions }
|
|
31
31
|
@enabled = true
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -44,7 +44,7 @@ module IronTrail
|
|
|
44
44
|
$$ LANGUAGE plpgsql;
|
|
45
45
|
SQL
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
with_connection { |conn| conn.execute(sql) }
|
|
48
48
|
@enabled = false
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -65,6 +65,20 @@ module IronTrail
|
|
|
65
65
|
::IronTrail::Testing.enable!
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
|
+
|
|
69
|
+
private
|
|
70
|
+
|
|
71
|
+
# Checks out a connection for the duration of the block, mirroring
|
|
72
|
+
# ActiveRecord::Base.with_connection (Rails 7.2+). On Rails 7.1, where
|
|
73
|
+
# that method does not exist yet, it falls back to yielding the
|
|
74
|
+
# (soft-deprecated on Rails 8.1+) ActiveRecord::Base.connection.
|
|
75
|
+
def with_connection(&block)
|
|
76
|
+
if ActiveRecord::Base.respond_to?(:with_connection)
|
|
77
|
+
ActiveRecord::Base.with_connection(&block)
|
|
78
|
+
else
|
|
79
|
+
yield ActiveRecord::Base.connection
|
|
80
|
+
end
|
|
81
|
+
end
|
|
68
82
|
end
|
|
69
83
|
end
|
|
70
84
|
end
|
data/lib/iron_trail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iron_trail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0.pre.alpha1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Diego Piske
|
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
167
|
version: '0'
|
|
168
168
|
requirements: []
|
|
169
|
-
rubygems_version: 4.0.
|
|
169
|
+
rubygems_version: 4.0.16
|
|
170
170
|
specification_version: 4
|
|
171
171
|
summary: Creates a trail strong as iron
|
|
172
172
|
test_files: []
|