om 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.textile CHANGED
@@ -1,3 +1,8 @@
1
+ h3. 1.5.1
2
+
3
+ HYDRA-737 OM tests fail under ree 1.8.7-2011.12
4
+ (Fix also applies to ruby 1.8.7-p357)
5
+
1
6
  h3. 1.5.0
2
7
 
3
8
  HYDRA-358 Added support for namespaceless terminologies
data/lib/om/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Om
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
@@ -67,7 +67,8 @@ module OM
67
67
 
68
68
  def val=(args)
69
69
  new_values = sanitize_new_values(args.first)
70
- new_values.each do |y,z|
70
+ new_values.keys.sort { |a,b| a.to_i <=> b.to_i }.each do |y|
71
+ z = new_values[y]
71
72
  ## If we pass something that already has an index on it, we should be able to add it.
72
73
  if @document.find_by_xpath(xpath)[y.to_i].nil? || y.to_i == -1
73
74
  @document.term_values_append(:parent_select=> parent.to_pointer,:parent_index=>0,:template=>to_pointer,:values=>z)
@@ -57,11 +57,10 @@ module OM::XML::TermValueOperators
57
57
 
58
58
  # Skip any submitted values if the new value matches the current values
59
59
  current_values = term_values(*pointer)
60
- new_values.delete_if do |y,z|
60
+ new_values.keys.sort { |a,b| a.to_i <=> b.to_i }.each do |y|
61
+ z = new_values[y]
61
62
  if current_values[y.to_i]==z and y.to_i > -1
62
- true
63
- else
64
- false
63
+ new_values.delete(y)
65
64
  end
66
65
  end
67
66
 
@@ -78,7 +77,8 @@ module OM::XML::TermValueOperators
78
77
  parent_xpath = self.class.terminology.xpath_with_indexes(*parent_pointer)
79
78
 
80
79
  # If the value doesn't exist yet, append it. Otherwise, update the existing value.
81
- new_values.each do |y,z|
80
+ new_values.keys.sort { |a,b| a.to_i <=> b.to_i }.each do |y|
81
+ z = new_values[y]
82
82
  if find_by_terms(*pointer)[y.to_i].nil? || y.to_i == -1
83
83
  result[hn].delete(y)
84
84
  term_values_append(:parent_select=>parent_pointer,:parent_index=>0,:template=>template_pointer,:values=>z)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: om
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Zumwalt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-25 00:00:00 Z
18
+ date: 2012-01-30 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: nokogiri