Permalink
Browse files

use EquivalentXml on control group X datastreams, because fedora will…

… reorder things for you...
  • Loading branch information...
1 parent 2ec8fc1 commit b80ce923e87a2e7782c415a280e20082855c471f @cbeer committed Dec 20, 2012
Showing with 7 additions and 2 deletions.
  1. +6 −2 lib/rubydora/datastream.rb
  2. +1 −0 rubydora.gemspec
@@ -1,3 +1,4 @@
+require 'equivalent-xml'
module Rubydora
# This class represents a Fedora datastream object
# and provides helper methods for creating and manipulating
@@ -180,8 +181,11 @@ def content_changed?
return false if ['E','R'].include? controlGroup
return true if new? and !content.blank? # new datastreams must have content
- return true unless content == datastream_content
-
+ if controlGroup == "X"
+ return true unless EquivalentXml.equivalent?(Nokogiri::XML(content), Nokogiri::XML(datastream_content))
+ else
+ return true unless content == datastream_content
+ end
super
end
View
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
s.add_dependency "fastercsv"
s.add_dependency "rest-client"
s.add_dependency "nokogiri"
+ s.add_dependency "equivalent-xml"
s.add_dependency "mime-types"
s.add_dependency "activesupport"
s.add_dependency "activemodel"

0 comments on commit b80ce92

Please sign in to comment.