iron_trail 0.3.0.pre.alpha1 → 0.3.0.pre.alpha2
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/change_model_concern.rb +2 -2
- data/lib/iron_trail/testing/rspec.rb +2 -16
- data/lib/iron_trail/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93a89936a73c9adda2859dc0efed14fe01dca6660492d052059632dd538353e4
|
|
4
|
+
data.tar.gz: c96fc6cfc41206aa320ac8c7ea8901ec53b74114d60adc8cd3bf100b68c52b22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5771fd86323e2166e29d9bb35deb599c740d6e75c36f936781d1a299a9584f8b1318b168eaef58b225a764146d02ec07221e3d3e9c1fb3d086be6ff5c3d0ba98
|
|
7
|
+
data.tar.gz: 2e4ed3d32fb33b0ed5f4a98e1a2e7036408b3db5c4bd557e3508f343e5859ba0d3a39118dca0143296797db0e998211300422452afd5225fd546e18ac53d4adc
|
|
@@ -66,7 +66,7 @@ module IronTrail
|
|
|
66
66
|
# This works by inspecting whether there are any keys in the rec_delta column
|
|
67
67
|
# other than the columns specified in the `columns` parameter.
|
|
68
68
|
def with_delta_other_than(*columns)
|
|
69
|
-
quoted_columns = columns.map { |col_name|
|
|
69
|
+
quoted_columns = columns.map { |col_name| lease_connection.quote(col_name) }
|
|
70
70
|
exclude_array = "ARRAY[#{quoted_columns.join(', ')}]::text[]"
|
|
71
71
|
|
|
72
72
|
sql = "rec_delta IS NULL OR (rec_delta - #{exclude_array}) <> '{}'::jsonb"
|
|
@@ -80,7 +80,7 @@ module IronTrail
|
|
|
80
80
|
scope = all
|
|
81
81
|
|
|
82
82
|
args.each do |col_name, value|
|
|
83
|
-
col_delta = "rec_delta->#{
|
|
83
|
+
col_delta = "rec_delta->#{lease_connection.quote(col_name)}"
|
|
84
84
|
node = if value == nil
|
|
85
85
|
::Arel::Nodes::SqlLiteral.new("#{col_delta}->#{ary_index} = 'null'::jsonb")
|
|
86
86
|
else
|
|
@@ -27,7 +27,7 @@ module IronTrail
|
|
|
27
27
|
attr_accessor :enabled
|
|
28
28
|
|
|
29
29
|
def enable!
|
|
30
|
-
with_connection { |conn| DbFunctions.new(conn).install_functions }
|
|
30
|
+
ActiveRecord::Base.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
|
-
with_connection { |conn| conn.execute(sql) }
|
|
47
|
+
ActiveRecord::Base.with_connection { |conn| conn.execute(sql) }
|
|
48
48
|
@enabled = false
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -65,20 +65,6 @@ 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
|
|
82
68
|
end
|
|
83
69
|
end
|
|
84
70
|
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.3.0.pre.
|
|
4
|
+
version: 0.3.0.pre.alpha2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Diego Piske
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '8.0'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '8.0'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: appraisal
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -77,14 +77,14 @@ dependencies:
|
|
|
77
77
|
requirements:
|
|
78
78
|
- - "~>"
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '1.
|
|
80
|
+
version: '1.6'
|
|
81
81
|
type: :development
|
|
82
82
|
prerelease: false
|
|
83
83
|
version_requirements: !ruby/object:Gem::Requirement
|
|
84
84
|
requirements:
|
|
85
85
|
- - "~>"
|
|
86
86
|
- !ruby/object:Gem::Version
|
|
87
|
-
version: '1.
|
|
87
|
+
version: '1.6'
|
|
88
88
|
- !ruby/object:Gem::Dependency
|
|
89
89
|
name: json
|
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -105,14 +105,14 @@ dependencies:
|
|
|
105
105
|
requirements:
|
|
106
106
|
- - "~>"
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '
|
|
108
|
+
version: '8.0'
|
|
109
109
|
type: :development
|
|
110
110
|
prerelease: false
|
|
111
111
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements:
|
|
113
113
|
- - "~>"
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
115
|
+
version: '8.0'
|
|
116
116
|
email: andrepiske@gmail.com
|
|
117
117
|
executables: []
|
|
118
118
|
extensions: []
|
|
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
159
159
|
requirements:
|
|
160
160
|
- - ">="
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
|
-
version: 3.
|
|
162
|
+
version: 3.4.0
|
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
requirements:
|
|
165
165
|
- - ">="
|