active_record-comments 1.0.0 → 1.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ebb348d2ac167aa5d2caf6bed63f158dd18a7f3d15dee7938575a6b927ea688
|
|
4
|
+
data.tar.gz: 9d4620a2343c79d922f398092dce0d07a925232734245e37f3333b9a86d972b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1836b9c02f042585d08876707e2802874e36e771b4e62f141b50ed17c179c5a0cd1a67a8c6dde90a67a2ff556c1c8a70b4aa82c1b432f29ab7184935493095a
|
|
7
|
+
data.tar.gz: '08af0f49517f7b771d56fd0604074a217220bcbcc360ef06ba46e2c9a10686c0ee2f99d1bc0dfdbda76bd2a34ce29ebf9ab9223a2f9cef557c0ef77b823df2f2'
|
|
@@ -6,10 +6,10 @@ module ActiveRecord
|
|
|
6
6
|
base.class_eval do
|
|
7
7
|
# ActiveRecord 7.1
|
|
8
8
|
if base.method_defined?(:internal_exec_query)
|
|
9
|
-
alias_method :
|
|
9
|
+
alias_method :internal_exec_query_without_comment, :internal_exec_query
|
|
10
10
|
def internal_exec_query(query, *args, **kwargs, &block)
|
|
11
11
|
query = ActiveRecord::Comments.with_comment_sql(query)
|
|
12
|
-
|
|
12
|
+
internal_exec_query_without_comment(query, *args, **kwargs, &block)
|
|
13
13
|
end
|
|
14
14
|
# ActiveRecord 3.2 vs sqlite, maybe others ...
|
|
15
15
|
elsif base.method_defined?(:exec_query)
|
|
@@ -57,5 +57,12 @@ module ActiveRecord
|
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
|
+
|
|
61
|
+
module ExecuteIntentWithComments
|
|
62
|
+
def execute!
|
|
63
|
+
@processed_sql = ::ActiveRecord::Comments.with_comment_sql(processed_sql)
|
|
64
|
+
super
|
|
65
|
+
end
|
|
66
|
+
end
|
|
60
67
|
end
|
|
61
68
|
end
|
|
@@ -39,4 +39,10 @@ module ActiveRecord
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
ActiveRecord::
|
|
42
|
+
if defined?(ActiveRecord::ConnectionAdapters::QueryIntent)
|
|
43
|
+
# Rails 8.2
|
|
44
|
+
ActiveRecord::ConnectionAdapters::QueryIntent.prepend(::ActiveRecord::Comments::ExecuteIntentWithComments)
|
|
45
|
+
else
|
|
46
|
+
# Rails 8.1 and older
|
|
47
|
+
ActiveRecord::Comments::ExecuteWithComments.install!
|
|
48
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_record-comments
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Grosser
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
requirements: []
|
|
56
|
-
rubygems_version: 3.
|
|
56
|
+
rubygems_version: 3.4.10
|
|
57
57
|
signing_key:
|
|
58
58
|
specification_version: 4
|
|
59
59
|
summary: Comments for activerecord
|