active_record-comments 0.1.2 → 0.1.3

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: c599f57368d0de3b4b2e339481169ab663d550b9
4
- data.tar.gz: 98dd62ff70078bccf5f97b16a9d1ab93be54fe4e
3
+ metadata.gz: cf15c21750c806f5bdb24a514c2f28d0bd03d166
4
+ data.tar.gz: c24c12d8b6f8bc3775358967abcf054cc6e38f1c
5
5
  SHA512:
6
- metadata.gz: 06e38ae6a63ec013a18bbd958e4280cd5f0aa04aa505fee0ba1ef49dba303ff6699c7c2208c80ca9869af580ddf678aeb7657142f5efbc6a5f133472cc5fc5e0
7
- data.tar.gz: ab039594fc92b291318904f9070108d30c57c8604e1344a1e560b596f6c831c67ee1debf997e497c82018f85300c6000e51c85053330a1cc6e9653670211fc26
6
+ metadata.gz: 1ff24880b18d55974018784f6597ea57aa34cc92b51011a85c371d6520d7d1c176f767a6e0e349a376ca07d281c8715b63c7b0409758c6b300533ea5e39d26d1
7
+ data.tar.gz: a88d754b531c0ce90dbe2a9256ec063f24804aeeaf5c8d30a3b5675eab4416bc79d3a4b8606e2c27703b73956b00ba9cb0c8bdccb962d030d42773928c5c7cb5
@@ -53,11 +53,10 @@ module ActiveRecord
53
53
 
54
54
  class << self
55
55
  def comment(comment)
56
- @comment ||= []
57
- @comment << comment
56
+ current_comments << comment
58
57
  yield
59
58
  ensure
60
- @comment.pop
59
+ current_comments.pop
61
60
  end
62
61
 
63
62
  def with_comment_sql(sql)
@@ -66,9 +65,12 @@ module ActiveRecord
66
65
  end
67
66
 
68
67
  private
68
+ def current_comments
69
+ Thread.current[:ar_comments] ||= []
70
+ end
69
71
 
70
72
  def current_comment
71
- @comment.join(" ") if @comment.present?
73
+ current_comments.join(" ") if current_comments.present?
72
74
  end
73
75
  end
74
76
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-comments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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-05 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description:
@@ -42,17 +42,17 @@ require_paths:
42
42
  - lib
43
43
  required_ruby_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
54
  rubyforge_project:
55
- rubygems_version: 2.0.3
55
+ rubygems_version: 2.2.3
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: Comments for activerecord