rocket_tag 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +17 -17
- data/VERSION +1 -1
- data/lib/rocket_tag/taggable.rb +9 -9
- data/rocket_tag.gemspec +5 -5
- metadata +4 -4
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gem "squeel", '~> 1.0.0', :require => false
|
|
8
8
|
# Add dependencies to develop your gem here.
|
9
9
|
# Include everything needed to run rake, tests, features, etc.
|
10
10
|
group :development do
|
11
|
-
gem "rspec", "~> 2.
|
11
|
+
gem "rspec", "~> 2.10.0"
|
12
12
|
gem "yard", "~> 0.6.0"
|
13
13
|
gem "bundler", "~> 1.1.0"
|
14
14
|
gem "jeweler", "~> 1.6.4"
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activemodel (3.2.
|
5
|
-
activesupport (= 3.2.
|
4
|
+
activemodel (3.2.6)
|
5
|
+
activesupport (= 3.2.6)
|
6
6
|
builder (~> 3.0.0)
|
7
|
-
activerecord (3.2.
|
8
|
-
activemodel (= 3.2.
|
9
|
-
activesupport (= 3.2.
|
7
|
+
activerecord (3.2.6)
|
8
|
+
activemodel (= 3.2.6)
|
9
|
+
activesupport (= 3.2.6)
|
10
10
|
arel (~> 3.0.2)
|
11
11
|
tzinfo (~> 0.3.29)
|
12
|
-
activesupport (3.2.
|
12
|
+
activesupport (3.2.6)
|
13
13
|
i18n (~> 0.6)
|
14
14
|
multi_json (~> 1.0)
|
15
15
|
arel (3.0.2)
|
@@ -21,20 +21,20 @@ GEM
|
|
21
21
|
bundler (~> 1.0)
|
22
22
|
git (>= 1.2.5)
|
23
23
|
rake
|
24
|
-
multi_json (1.3.
|
24
|
+
multi_json (1.3.6)
|
25
25
|
polyamorous (0.5.0)
|
26
26
|
activerecord (~> 3.0)
|
27
27
|
rake (0.9.2.2)
|
28
|
-
rspec (2.
|
29
|
-
rspec-core (~> 2.
|
30
|
-
rspec-expectations (~> 2.
|
31
|
-
rspec-mocks (~> 2.
|
32
|
-
rspec-core (2.
|
33
|
-
rspec-expectations (2.
|
34
|
-
diff-lcs (~> 1.1.
|
35
|
-
rspec-mocks (2.
|
28
|
+
rspec (2.10.0)
|
29
|
+
rspec-core (~> 2.10.0)
|
30
|
+
rspec-expectations (~> 2.10.0)
|
31
|
+
rspec-mocks (~> 2.10.0)
|
32
|
+
rspec-core (2.10.1)
|
33
|
+
rspec-expectations (2.10.0)
|
34
|
+
diff-lcs (~> 1.1.3)
|
35
|
+
rspec-mocks (2.10.1)
|
36
36
|
sqlite3 (1.3.5)
|
37
|
-
squeel (1.0.
|
37
|
+
squeel (1.0.6)
|
38
38
|
activerecord (~> 3.0)
|
39
39
|
activesupport (~> 3.0)
|
40
40
|
polyamorous (~> 0.5.0)
|
@@ -49,7 +49,7 @@ DEPENDENCIES
|
|
49
49
|
bundler (~> 1.1.0)
|
50
50
|
jeweler (~> 1.6.4)
|
51
51
|
rake
|
52
|
-
rspec (~> 2.
|
52
|
+
rspec (~> 2.10.0)
|
53
53
|
sqlite3
|
54
54
|
squeel (~> 1.0.0)
|
55
55
|
yard (~> 0.6.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/lib/rocket_tag/taggable.rb
CHANGED
@@ -44,7 +44,7 @@ module RocketTag
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def taggings_for_context context
|
47
|
-
taggings.where{taggings.context==
|
47
|
+
taggings.where{taggings.context==context.to_s}
|
48
48
|
end
|
49
49
|
|
50
50
|
def destroy_tags_for_context context
|
@@ -103,7 +103,7 @@ module RocketTag
|
|
103
103
|
conditions = contexts.map do |context|
|
104
104
|
_tags = send context.to_sym
|
105
105
|
self.class.squeel do
|
106
|
-
(tags.name.in(
|
106
|
+
(tags.name.in(_tags) & (taggings.context == context.to_s))
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -130,7 +130,7 @@ module RocketTag
|
|
130
130
|
|
131
131
|
def _with_tag_context context
|
132
132
|
if context
|
133
|
-
where{taggings.context ==
|
133
|
+
where{taggings.context == context.to_s}
|
134
134
|
else
|
135
135
|
where{ }
|
136
136
|
end
|
@@ -156,7 +156,7 @@ module RocketTag
|
|
156
156
|
inner = select{count(~id).as(tags_count)}.
|
157
157
|
select("#{self.table_name}.*").
|
158
158
|
joins{tags}.
|
159
|
-
where{tags.name.in(
|
159
|
+
where{tags.name.in(tags_list)}.
|
160
160
|
_with_tag_context(on).
|
161
161
|
group(self.column_names.map{|col| "#{self.table_name}.#{col}"})
|
162
162
|
|
@@ -166,11 +166,11 @@ module RocketTag
|
|
166
166
|
r = from("(#{inner.to_sql}) #{table_name}")
|
167
167
|
|
168
168
|
if options.delete :all
|
169
|
-
r = r.where{tags_count==
|
169
|
+
r = r.where{tags_count==tags_list.length}
|
170
170
|
end
|
171
171
|
|
172
172
|
if min = options.delete(:min)
|
173
|
-
r = r.where{tags_count>=
|
173
|
+
r = r.where{tags_count>=min}
|
174
174
|
end
|
175
175
|
|
176
176
|
if options.delete :sifter
|
@@ -199,7 +199,7 @@ module RocketTag
|
|
199
199
|
|
200
200
|
conditions = contexts.map do |context|
|
201
201
|
squeel do
|
202
|
-
(taggings.context ==
|
202
|
+
(taggings.context == context.to_s)
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
@@ -215,7 +215,7 @@ module RocketTag
|
|
215
215
|
r = from("(#{inner.to_sql}) #{table_name}")
|
216
216
|
|
217
217
|
if min = options.delete(:min)
|
218
|
-
r = r.where{tags_count>=
|
218
|
+
r = r.where{tags_count>=min}
|
219
219
|
end
|
220
220
|
|
221
221
|
if options.delete :sifter
|
@@ -246,7 +246,7 @@ module RocketTag
|
|
246
246
|
destroy_tags_for_context context
|
247
247
|
|
248
248
|
# Find existing tags
|
249
|
-
exisiting_tags = Tag.where{name.in(
|
249
|
+
exisiting_tags = Tag.where{name.in(list)}
|
250
250
|
exisiting_tag_names = exisiting_tags.map &:name
|
251
251
|
|
252
252
|
# Find missing tags
|
data/rocket_tag.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "rocket_tag"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brad Phelan"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-26"
|
13
13
|
s.description = ""
|
14
14
|
s.email = "bradphelan@xtargets.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -51,7 +51,7 @@ Gem::Specification.new do |s|
|
|
51
51
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
52
|
s.add_runtime_dependency(%q<activerecord>, [">= 3.2.0"])
|
53
53
|
s.add_runtime_dependency(%q<squeel>, ["~> 1.0.0"])
|
54
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.
|
54
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.10.0"])
|
55
55
|
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
|
56
56
|
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
57
57
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
|
|
60
60
|
else
|
61
61
|
s.add_dependency(%q<activerecord>, [">= 3.2.0"])
|
62
62
|
s.add_dependency(%q<squeel>, ["~> 1.0.0"])
|
63
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 2.10.0"])
|
64
64
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
65
65
|
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
66
66
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
@@ -70,7 +70,7 @@ Gem::Specification.new do |s|
|
|
70
70
|
else
|
71
71
|
s.add_dependency(%q<activerecord>, [">= 3.2.0"])
|
72
72
|
s.add_dependency(%q<squeel>, ["~> 1.0.0"])
|
73
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
73
|
+
s.add_dependency(%q<rspec>, ["~> 2.10.0"])
|
74
74
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
75
75
|
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
76
76
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rocket_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brad Phelan
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-06-
|
13
|
+
date: 2012-06-26 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 2.
|
44
|
+
version: 2.10.0
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: *id003
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
hash: -
|
147
|
+
hash: -285597818413014276
|
148
148
|
segments:
|
149
149
|
- 0
|
150
150
|
version: "0"
|