active_record-comments 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_record/comments.rb +6 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf15c21750c806f5bdb24a514c2f28d0bd03d166
|
4
|
+
data.tar.gz: c24c12d8b6f8bc3775358967abcf054cc6e38f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
57
|
-
@comment << comment
|
56
|
+
current_comments << comment
|
58
57
|
yield
|
59
58
|
ensure
|
60
|
-
|
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
|
-
|
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.
|
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:
|
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.
|
55
|
+
rubygems_version: 2.2.3
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: Comments for activerecord
|