active_record-comments 0.7.0 → 0.9.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: 5647f74def91a735d09ad9ba1f4216e13db28cd2591460dfe6aea8d48cdf7f00
4
+ data.tar.gz: 54ca149282b5512666a6cbcb843b78fd73dcb64afd6e94ef79fda09354930cec
5
5
  SHA512:
6
- metadata.gz: d346cbc89261f1c1e7986e6b858c66b8b30bb3f16d5ef0d40e592f7c458801ea85481b97d70a114586580cce84e657873bff1743b69e367325bb3385f6d4e539
7
- data.tar.gz: 926805dce6782cab753bf23e4c580f2df013b0a66d33f6dde1afb4b5c8ece77403227cd524593fa72631415e015faa952e6ba14cb69b90fef64b9092087cde6a
6
+ metadata.gz: d72b0ac57d68a354109071d8651e2dd53ce2907ba28170423132b642462f24356a7300e0d978403c89611d53fb72529b50a0179e685f2ee40dc63fabdf74d133
7
+ data.tar.gz: 4713ee8ff61ceadda255a8721378764637d2872c66df32828ea40854f7621e7f1b96175f5544227507ad7f1b312174fae2bf128aa4b4096d4321ae5d15ac0d02
@@ -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.9.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.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2024-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '7.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,10 +24,7 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '5'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '7.1'
33
- description:
27
+ description:
34
28
  email: michael@grosser.it
35
29
  executables: []
36
30
  extensions: []
@@ -44,7 +38,7 @@ homepage: https://github.com/grosser/active_record-comments
44
38
  licenses:
45
39
  - MIT
46
40
  metadata: {}
47
- post_install_message:
41
+ post_install_message:
48
42
  rdoc_options: []
49
43
  require_paths:
50
44
  - lib
@@ -60,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
54
  version: '0'
61
55
  requirements: []
62
56
  rubygems_version: 3.1.6
63
- signing_key:
57
+ signing_key:
64
58
  specification_version: 4
65
59
  summary: Comments for activerecord
66
60
  test_files: []