rubydora 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rubydora/datastream.rb +8 -6
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -134,6 +134,8 @@ module Rubydora
134
134
  alias_method :read, :content
135
135
 
136
136
  def datastream_content
137
+ return nil if new?
138
+
137
139
  @datastream_content ||=begin
138
140
  options = { :pid => pid, :dsid => dsid }
139
141
  options[:asOfDateTime] = asOfDateTime if asOfDateTime
@@ -167,16 +169,16 @@ module Rubydora
167
169
  end
168
170
 
169
171
  def content_changed?
170
- # we have content
171
- return true if new? # new datastreams must have content
172
+ return true if new? and !content.blank? # new datastreams must have content
173
+
174
+ return true unless content == datastream_content
175
+
172
176
 
173
- # compare content against the original datastream content, if it is conventient
174
- return true if datastream_content_loaded? and has_content? and content != datastream_content
175
177
  super
176
178
  end
177
179
 
178
- def datastream_content_loaded?
179
- instance_variable_defined?(:@datastream_content)
180
+ def changed?
181
+ super || content_changed?
180
182
  end
181
183
 
182
184
  def has_content?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydora
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -286,7 +286,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
286
  version: '0'
287
287
  segments:
288
288
  - 0
289
- hash: 2972472270230562990
289
+ hash: 206159229600052997
290
290
  required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  none: false
292
292
  requirements:
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  version: '0'
296
296
  segments:
297
297
  - 0
298
- hash: 2972472270230562990
298
+ hash: 206159229600052997
299
299
  requirements: []
300
300
  rubyforge_project:
301
301
  rubygems_version: 1.8.23