datts_right 0.0.30 → 0.0.31

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datts_right (0.0.29)
4
+ datts_right (0.0.31)
5
5
  datts_right
6
6
 
7
7
  GEM
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.30
1
+ 0.0.31
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{datts_right}
8
- s.version = "0.0.30"
8
+ s.version = "0.0.31"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ramon Tayag"]
@@ -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: 35
4
+ hash: 33
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 30
10
- version: 0.0.30
9
+ - 31
10
+ version: 0.0.31
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ramon Tayag