active-fedora 10.0.0.beta3 → 10.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02a7ebf7a35811e4066a8fe6c45d1ac3c295c35b
4
- data.tar.gz: ff66c823b1eada725f5d49a91bcb024c394a19e0
3
+ metadata.gz: e36715dc8027b42414b4eb6ee41de795e32dd2a1
4
+ data.tar.gz: 9dcf77ceae0e395977a06a31164787df2ef23f81
5
5
  SHA512:
6
- metadata.gz: fa74e8f37edda9ac76f75f7171314ec8fa3d5ecbe3777acc9634ede021ae598475bbc9632b82da45a661584cd651b1ca31b9c8641134e45bbbed1af4de760550
7
- data.tar.gz: 531c7c807e725d6186d37954185b3045d5790c392d39ef23ee7489642cbfa1bde0c5786b1bb66688f845780f8dd1904f62fc96c4db2d54ccc5f8a9000d1ec556
6
+ metadata.gz: 01bd95f9fae07b1d327f7c5eae435357b29c5edac4062707087e56f070a8701bc77a5d5a4209b63434c016f457ce1202bbccb69158b4cb73bf74c8cde4e52228
7
+ data.tar.gz: 56cfeed533c1c9cfc0360e9b386d625392f9f60d77f531f30f909725b94d29d3aab782e6b1115e15d1f781c965ae5b603d508fc825d88f5d7d006ea23c02f250
@@ -48,12 +48,6 @@ module ActiveFedora
48
48
  end
49
49
  end
50
50
 
51
- def save
52
- super.tap do
53
- metadata.save if metadata.changed?
54
- end
55
- end
56
-
57
51
  def described_by
58
52
  raise "#{self} isn't persisted yet" if new_record?
59
53
  links['describedby'].first
@@ -176,6 +170,12 @@ module ActiveFedora
176
170
 
177
171
  private
178
172
 
173
+ def create_or_update(*options)
174
+ super.tap do
175
+ metadata.save if metadata.changed?
176
+ end
177
+ end
178
+
179
179
  # Rack::Test::UploadedFile is often set via content=, however it's not an IO, though it wraps an io object.
180
180
  def behaves_like_io?(obj)
181
181
  [IO, Tempfile, StringIO].any? { |klass| obj.is_a? klass } || (defined?(Rack) && obj.is_a?(Rack::Test::UploadedFile))
@@ -38,7 +38,6 @@ module ActiveFedora
38
38
  solr_doc = {}
39
39
  Solrizer.set_field(solr_doc, 'system_create', c_time, :stored_sortable)
40
40
  Solrizer.set_field(solr_doc, 'system_modified', m_time, :stored_sortable)
41
- Solrizer.set_field(solr_doc, 'active_fedora_model', object.class.inspect, :stored_sortable)
42
41
  solr_doc[QueryResultBuilder::HAS_MODEL_SOLR_FIELD] = object.has_model
43
42
  solr_doc[ActiveFedora.id_field.to_sym] = object.id
44
43
  solr_doc[self.class.profile_solr_name] = profile_service.new(object).export
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "10.0.0.beta3".freeze
2
+ VERSION = "10.0.0.beta4".freeze
3
3
  end
@@ -102,7 +102,6 @@
102
102
  -->
103
103
  <str name="qf">
104
104
  id
105
- active_fedora_model_ssi
106
105
  title_tesim
107
106
  author_tesim
108
107
  subject_tesim
@@ -102,7 +102,6 @@
102
102
  -->
103
103
  <str name="qf">
104
104
  id
105
- active_fedora_model_ssi
106
105
  title_tesim
107
106
  author_tesim
108
107
  subject_tesim
@@ -7,6 +7,21 @@ describe ActiveFedora::File do
7
7
 
8
8
  it { is_expected.not_to be_metadata }
9
9
 
10
+ describe "#save!" do
11
+ context "when updating metadata" do
12
+ before do
13
+ file.content = 'foo'
14
+ file.save!
15
+ file.mime_type = 'application/pdf'
16
+ end
17
+
18
+ it "Updates metadata" do
19
+ expect(file.metadata).to receive(:save)
20
+ file.save!
21
+ end
22
+ end
23
+ end
24
+
10
25
  describe "#behaves_like_io?" do
11
26
  subject { file.send(:behaves_like_io?, object) }
12
27
 
@@ -71,10 +71,6 @@ describe ActiveFedora::Indexing do
71
71
  expect(solr_doc[:id]).to eql("changeme:123")
72
72
  end
73
73
 
74
- it "adds self.class as the :active_fedora_model" do
75
- expect(subject[ActiveFedora.index_field_mapper.solr_name("active_fedora_model", :stored_sortable)]).to eql "SpecNode"
76
- end
77
-
78
74
  context "with attached files" do
79
75
  let(:mock1) { double("ds1") }
80
76
  let(:mock2) { double("ds2") }
@@ -95,11 +95,11 @@ describe ActiveFedora::Base do
95
95
  end
96
96
 
97
97
  it "queries for empty strings" do
98
- expect(SpecModel::Basic.where(active_fedora_model_ssi: '').count).to eq 0
98
+ expect(SpecModel::Basic.where(has_model_ssim: '').count).to eq 0
99
99
  end
100
100
 
101
101
  it 'queries for empty arrays' do
102
- expect(SpecModel::Basic.where(active_fedora_model_ssi: []).count).to eq 0
102
+ expect(SpecModel::Basic.where(has_model_ssim: []).count).to eq 0
103
103
  end
104
104
 
105
105
  it "adds options" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0.beta3
4
+ version: 10.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-23 00:00:00.000000000 Z
13
+ date: 2016-06-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -777,7 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
777
777
  version: 1.3.1
778
778
  requirements: []
779
779
  rubyforge_project:
780
- rubygems_version: 2.6.4
780
+ rubygems_version: 2.5.1
781
781
  signing_key:
782
782
  specification_version: 4
783
783
  summary: A convenience libary for manipulating documents in the Fedora Repository.