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: 2aad6a4a0139628ec88c8a3c6dc5bf9d0a200925abc9c8886a99dc6db99fdf3f
4
- data.tar.gz: 991b910d1d63f13be3ddd9b5d7aac7e5d409d080912e0ab9712909abc240f67d
3
+ metadata.gz: 1ebb348d2ac167aa5d2caf6bed63f158dd18a7f3d15dee7938575a6b927ea688
4
+ data.tar.gz: 9d4620a2343c79d922f398092dce0d07a925232734245e37f3333b9a86d972b3
5
5
  SHA512:
6
- metadata.gz: 777a000deff27c4bc6589b3445a0e786d6f710c5a4057f34062addc38b80a938a339429736f0d4fd69dcf47deb1c2bafcf69487cf183a2b9bd133f7eb054c0a3
7
- data.tar.gz: efb51e9ee1ad6240dada36440502484adbf795359dc6e124297a23952b0c68846b0413c1484ac9770f7fffc32a5486061374a680044f62283b28a22ef1db9da9
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 :exec_query_without_comment, :internal_exec_query
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
- exec_query_without_comment(query, *args, **kwargs, &block)
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Comments
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
@@ -39,4 +39,10 @@ module ActiveRecord
39
39
  end
40
40
  end
41
41
 
42
- ActiveRecord::Comments::ExecuteWithComments.install!
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.0.0
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-04-15 00:00:00.000000000 Z
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.5.22
56
+ rubygems_version: 3.4.10
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Comments for activerecord