active_record-comments 0.11.0 → 1.1.0
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: eb953c9e84e5eda78d22750cd3326237b8c8636d389c3fdc0752a6855d79b172
|
|
4
|
+
data.tar.gz: 2f5b1b24920f261f3be90ff1ad60af32dcd76cab2337ccd1b603dccab7e50f65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff820e23eb5785b63d3dc1b144d6c185b6237953b9fabca1b037d3deabda95352b966f144259cfb0850e1cec3f6c22e0ad7bc57e7e32436197e6aca452cb522e
|
|
7
|
+
data.tar.gz: 13fd57e87378f9e1a61650e075fcbdb979cf5dd554ccccd7b54e74321bddf29783d36cf9db6ba3b5976be80f05d63c6f3743ce40de15dd64f6fc695f3de79942
|
|
@@ -4,12 +4,26 @@ module ActiveRecord
|
|
|
4
4
|
class << self
|
|
5
5
|
def included(base)
|
|
6
6
|
base.class_eval do
|
|
7
|
+
# ActiveRecord 8.2
|
|
8
|
+
if defined?(ActiveRecord::ConnectionAdapters::QueryIntent)
|
|
9
|
+
alias_method :raw_execute_without_comment, :raw_execute
|
|
10
|
+
def raw_execute(intent)
|
|
11
|
+
compile_arel_in_intent(intent)
|
|
12
|
+
|
|
13
|
+
if (sql = intent.processed_sql)
|
|
14
|
+
intent.processed_sql = ActiveRecord::Comments.with_comment_sql(sql)
|
|
15
|
+
elsif (sql = intent.raw_sql)
|
|
16
|
+
intent.raw_sql = ActiveRecord::Comments.with_comment_sql(sql)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
raw_execute_without_comment(intent)
|
|
20
|
+
end
|
|
7
21
|
# ActiveRecord 7.1
|
|
8
|
-
|
|
9
|
-
alias_method :
|
|
22
|
+
elsif base.method_defined?(:internal_exec_query)
|
|
23
|
+
alias_method :internal_exec_query_without_comment, :internal_exec_query
|
|
10
24
|
def internal_exec_query(query, *args, **kwargs, &block)
|
|
11
25
|
query = ActiveRecord::Comments.with_comment_sql(query)
|
|
12
|
-
|
|
26
|
+
internal_exec_query_without_comment(query, *args, **kwargs, &block)
|
|
13
27
|
end
|
|
14
28
|
# ActiveRecord 3.2 vs sqlite, maybe others ...
|
|
15
29
|
elsif base.method_defined?(:exec_query)
|
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:
|
|
4
|
+
version: 1.1.0
|
|
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-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '7.1'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '7.1'
|
|
27
27
|
description:
|
|
28
28
|
email: michael@grosser.it
|
|
29
29
|
executables: []
|
|
@@ -46,14 +46,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '2
|
|
49
|
+
version: '3.2'
|
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|
|
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
|