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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f3d063aaa596c171fa3fa92e31be8745f38c880310ca51afc9a32d8db64b7c9
|
4
|
+
data.tar.gz: 9b1c2ae2bb85a846e690ac0f8e08fa032795cc9ccce090b55c94e85158909f95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
15
|
+
elsif base.method_defined?(:exec_query)
|
9
16
|
alias_method :exec_query_without_comment, :exec_query
|
10
|
-
def exec_query(query, *args,
|
17
|
+
def exec_query(query, *args, **kwargs, &block)
|
11
18
|
query = ActiveRecord::Comments.with_comment_sql(query)
|
12
|
-
exec_query_without_comment(query, *args,
|
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)
|
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.
|
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:
|
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.
|
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.
|
32
|
+
version: '7.2'
|
33
33
|
description:
|
34
34
|
email: michael@grosser.it
|
35
35
|
executables: []
|