active_record-comments 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f79bfb7213807835f81d17686c87f9f233aabe057710299cb4aa5bf6aa59e4c
4
- data.tar.gz: 5293187c60b76026b78c28feabb71806bf9da825a466ce0710a36758fc768dee
3
+ metadata.gz: 2f3d063aaa596c171fa3fa92e31be8745f38c880310ca51afc9a32d8db64b7c9
4
+ data.tar.gz: 9b1c2ae2bb85a846e690ac0f8e08fa032795cc9ccce090b55c94e85158909f95
5
5
  SHA512:
6
- metadata.gz: d346cbc89261f1c1e7986e6b858c66b8b30bb3f16d5ef0d40e592f7c458801ea85481b97d70a114586580cce84e657873bff1743b69e367325bb3385f6d4e539
7
- data.tar.gz: 926805dce6782cab753bf23e4c580f2df013b0a66d33f6dde1afb4b5c8ece77403227cd524593fa72631415e015faa952e6ba14cb69b90fef64b9092087cde6a
6
+ metadata.gz: b1eafcfa480e6dd6dd4c69cc6cbe81bc11828a27f0c49ec49fe001f8e0b8baf276e26b753385473e7823243a3736a9a212e418158e90411e73baf941edc516f5
7
+ data.tar.gz: ea2f8d1591d25617513aa1aeb84903ff38e8bd6f85fc07c5eea28e73126deeb3de8ee3973d1a0ef8a3c84b6c0017451c53491d5ebfb1fc92d003528a772e6fac
@@ -4,15 +4,20 @@ module ActiveRecord
4
4
  class << self
5
5
  def included(base)
6
6
  base.class_eval do
7
+ # ActiveRecord 7.1
8
+ if base.method_defined?(:internal_exec_query)
9
+ alias_method :exec_query_without_comment, :internal_exec_query
10
+ def internal_exec_query(query, *args, **kwargs, &block)
11
+ query = ActiveRecord::Comments.with_comment_sql(query)
12
+ exec_query_without_comment(query, *args, **kwargs, &block)
13
+ end
7
14
  # ActiveRecord 3.2 vs sqlite, maybe others ...
8
- if base.method_defined?(:exec_query)
15
+ elsif base.method_defined?(:exec_query)
9
16
  alias_method :exec_query_without_comment, :exec_query
10
- def exec_query(query, *args, prepare: false, &block)
17
+ def exec_query(query, *args, **kwargs, &block)
11
18
  query = ActiveRecord::Comments.with_comment_sql(query)
12
- exec_query_without_comment(query, *args, prepare: prepare, &block)
19
+ exec_query_without_comment(query, *args, **kwargs, &block)
13
20
  end
14
-
15
- # 99% case
16
21
  elsif base.method_defined?(:execute)
17
22
  alias_method :execute_without_comment, :execute
18
23
  def execute(query, *args, &block)
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Comments
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.0"
4
4
  end
5
5
  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: 0.7.0
4
+ version: 0.8.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: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.2'
33
33
  description:
34
34
  email: michael@grosser.it
35
35
  executables: []