rocket_tag 0.0.0 → 0.0.1
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.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/rocket_tag/taggable.rb +5 -0
- data/rocket_tag.gemspec +1 -1
- data/spec/rocket_tag/taggable_spec.rb +9 -0
- metadata +2 -2
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/rocket_tag/taggable.rb
CHANGED
@@ -103,6 +103,11 @@ module RocketTag
|
|
103
103
|
:conditions => [ "taggings.context = ?", context ]
|
104
104
|
|
105
105
|
|
106
|
+
validate context do
|
107
|
+
if not send(context).kind_of? Enumerable
|
108
|
+
errors.add context, :invalid
|
109
|
+
end
|
110
|
+
end
|
106
111
|
before_save do
|
107
112
|
@tag_dirty ||= Set.new
|
108
113
|
|
data/rocket_tag.gemspec
CHANGED
@@ -18,7 +18,16 @@ describe TaggableModel do
|
|
18
18
|
@model.reload
|
19
19
|
@model.languages.should == ["x", "y"]
|
20
20
|
end
|
21
|
+
|
22
|
+
it "validates the model wrt to the context" do
|
23
|
+
@model.languages = 100
|
24
|
+
@model.save.should == false
|
25
|
+
pp @model.errors.messages
|
26
|
+
|
27
|
+
|
28
|
+
end
|
21
29
|
end
|
30
|
+
|
22
31
|
describe "#reload" do
|
23
32
|
it "resets the tags caches to what is in the database" do
|
24
33
|
@model.languages = ["a", "b", "c"]
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rocket_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brad Phelan
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
144
144
|
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
hash:
|
146
|
+
hash: 198466425924794403
|
147
147
|
segments:
|
148
148
|
- 0
|
149
149
|
version: "0"
|