active_record-comments 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record/comments.rb +8 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c599f57368d0de3b4b2e339481169ab663d550b9
|
4
|
+
data.tar.gz: 98dd62ff70078bccf5f97b16a9d1ab93be54fe4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e38ae6a63ec013a18bbd958e4280cd5f0aa04aa505fee0ba1ef49dba303ff6699c7c2208c80ca9869af580ddf678aeb7657142f5efbc6a5f133472cc5fc5e0
|
7
|
+
data.tar.gz: ab039594fc92b291318904f9070108d30c57c8604e1344a1e560b596f6c831c67ee1debf997e497c82018f85300c6000e51c85053330a1cc6e9653670211fc26
|
@@ -6,15 +6,6 @@ module ActiveRecord
|
|
6
6
|
class << self
|
7
7
|
def included(base)
|
8
8
|
base.class_eval do
|
9
|
-
# 99% case
|
10
|
-
if base.method_defined?(:execute)
|
11
|
-
alias_method :execute_without_comment, :execute
|
12
|
-
def execute(query, *args, &block)
|
13
|
-
query = ActiveRecord::Comments.with_comment_sql(query)
|
14
|
-
execute_without_comment(query, *args, &block)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
9
|
# ActiveRecord 3.2 vs sqlite, maybe others ...
|
19
10
|
if base.method_defined?(:exec_query)
|
20
11
|
alias_method :exec_query_without_comment, :exec_query
|
@@ -22,6 +13,14 @@ module ActiveRecord
|
|
22
13
|
query = ActiveRecord::Comments.with_comment_sql(query)
|
23
14
|
exec_query_without_comment(query, *args, &block)
|
24
15
|
end
|
16
|
+
|
17
|
+
# 99% case
|
18
|
+
elsif base.method_defined?(:execute)
|
19
|
+
alias_method :execute_without_comment, :execute
|
20
|
+
def execute(query, *args, &block)
|
21
|
+
query = ActiveRecord::Comments.with_comment_sql(query)
|
22
|
+
execute_without_comment(query, *args, &block)
|
23
|
+
end
|
25
24
|
end
|
26
25
|
end
|
27
26
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|