datts_right 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/datts_right.gemspec +1 -1
- data/lib/datts_right/instance_methods.rb +2 -2
- data/spec/datts_right/update_definition_spec.rb +6 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.31
|
data/datts_right.gemspec
CHANGED
@@ -187,8 +187,8 @@ module DattsRight
|
|
187
187
|
definition[key][k] = v unless k.to_s == "attr_key"
|
188
188
|
end
|
189
189
|
|
190
|
-
#puts "attr_key is #{attr_key}"
|
191
|
-
if attr_key
|
190
|
+
#puts "attr_key is #{attr_key}, key is #{key}"
|
191
|
+
if attr_key && attr_key != key.to_s
|
192
192
|
#puts "Adding definition: #{attr_key} => #{definition[key]}"
|
193
193
|
add_definition(attr_key, definition[key])
|
194
194
|
#puts "Removing definition: #{key} => #{definition[key]}"
|
@@ -21,6 +21,12 @@ describe DattsRight, ".update_definition(key, value)" do
|
|
21
21
|
c.definition[:bodi].should == {:object_type => "string"}
|
22
22
|
end
|
23
23
|
|
24
|
+
it "should not raise AlreadyDefined if the attr_key is the same" do
|
25
|
+
c = Category.create
|
26
|
+
c.definition = {:robot => {:object_type => "string"}}
|
27
|
+
lambda {c.update_definition(:robot, :attr_key => "robot")}.should_not raise_error(DattsRight::AlreadyDefined)
|
28
|
+
end
|
29
|
+
|
24
30
|
it "should be able to update the rest (all except attr_key) of the definition" do
|
25
31
|
c = Category.create
|
26
32
|
c.definition = {:robot => {:object_type => "string", :desc => "hi"}}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datts_right
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 33
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 31
|
10
|
+
version: 0.0.31
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ramon Tayag
|