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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9cad33bbee4634a2c13b3d6c108da34ac7c50e2
4
- data.tar.gz: ec4874db0062e24adccd9865022120a17f9f9c52
3
+ metadata.gz: c599f57368d0de3b4b2e339481169ab663d550b9
4
+ data.tar.gz: 98dd62ff70078bccf5f97b16a9d1ab93be54fe4e
5
5
  SHA512:
6
- metadata.gz: e68299120b751403d0dd037db7871ff60db3a523693bb248313a91f44255aeb438b651fb290b7113f5127597e9b4737215990c6c84f9dd0cb6b9a661db2ea84c
7
- data.tar.gz: ab64379e0934eee080442aec23049c8af2b9f30c33f9ed3f50da02888ce3f00978b584f6c007b96316b158671d7b50fdcbcb631d700a69a9cd5013b0d99c1842
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.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-03 00:00:00.000000000 Z
11
+ date: 2013-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord