active-fedora 10.1.0 → 11.1.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -7
- data/.rubocop_todo.yml +55 -0
- data/.solr_wrapper +6 -0
- data/.travis.yml +6 -9
- data/Gemfile +1 -0
- data/History.txt +34 -0
- data/README.md +1 -3
- data/active-fedora.gemspec +7 -13
- data/lib/active_fedora/aggregation/list_source.rb +2 -0
- data/lib/active_fedora/associations/association_scope.rb +1 -1
- data/lib/active_fedora/associations/builder/aggregation.rb +1 -1
- data/lib/active_fedora/associations/builder/association.rb +1 -1
- data/lib/active_fedora/associations/builder/orders.rb +11 -3
- data/lib/active_fedora/associations/collection_association.rb +5 -5
- data/lib/active_fedora/associations/collection_proxy.rb +10 -10
- data/lib/active_fedora/associations/contained_finder.rb +2 -2
- data/lib/active_fedora/associations/has_and_belongs_to_many_association.rb +1 -1
- data/lib/active_fedora/associations/has_many_association.rb +2 -2
- data/lib/active_fedora/associations/has_subresource_association.rb +2 -2
- data/lib/active_fedora/associations/orders_association.rb +4 -0
- data/lib/active_fedora/associations/rdf.rb +2 -0
- data/lib/active_fedora/attribute_assignment.rb +0 -1
- data/lib/active_fedora/attribute_methods/dirty.rb +1 -1
- data/lib/active_fedora/attribute_methods.rb +1 -1
- data/lib/active_fedora/attributes.rb +1 -1
- data/lib/active_fedora/base.rb +4 -8
- data/lib/active_fedora/change_set.rb +6 -2
- data/lib/active_fedora/cleaner.rb +1 -1
- data/lib/active_fedora/containers/container.rb +1 -1
- data/lib/active_fedora/core.rb +33 -30
- data/lib/active_fedora/fedora.rb +6 -2
- data/lib/active_fedora/fedora_attributes.rb +1 -1
- data/lib/active_fedora/file/streaming.rb +1 -1
- data/lib/active_fedora/file.rb +2 -1
- data/lib/active_fedora/file_configurator.rb +3 -3
- data/lib/active_fedora/indexing.rb +1 -18
- data/lib/active_fedora/indexing_service.rb +0 -9
- data/lib/active_fedora/initializing_connection.rb +1 -1
- data/lib/active_fedora/loadable_from_json.rb +12 -1
- data/lib/active_fedora/model_classifier.rb +1 -1
- data/lib/active_fedora/nested_attributes.rb +2 -2
- data/lib/active_fedora/null_logger.rb +10 -0
- data/lib/active_fedora/orders/list_node.rb +2 -2
- data/lib/active_fedora/orders/ordered_list.rb +8 -4
- data/lib/active_fedora/orders/target_proxy.rb +4 -0
- data/lib/active_fedora/querying.rb +1 -1
- data/lib/active_fedora/railtie.rb +2 -2
- data/lib/active_fedora/rake_support.rb +1 -1
- data/lib/active_fedora/rdf/field_map_entry.rb +6 -0
- data/lib/active_fedora/rdf/persistence.rb +1 -0
- data/lib/active_fedora/rdf/value_caster.rb +15 -0
- data/lib/active_fedora/rdf.rb +1 -1
- data/lib/active_fedora/relation/delegation.rb +4 -0
- data/lib/active_fedora/relation/finder_methods.rb +3 -1
- data/lib/active_fedora/solr_hit.rb +1 -14
- data/lib/active_fedora/solr_query_builder.rb +17 -13
- data/lib/active_fedora/version.rb +1 -1
- data/lib/active_fedora/with_metadata/metadata_node.rb +2 -1
- data/lib/active_fedora.rb +1 -12
- data/lib/generators/active_fedora/config/solr/templates/solr/config/solrconfig.xml +11 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml +1 -1
- data/lib/generators/active_fedora/model/model_generator.rb +1 -1
- data/lib/generators/active_fedora/model/templates/model.rb.erb +4 -4
- data/lib/tasks/active_fedora_dev.rake +1 -1
- data/spec/config_helper.rb +1 -1
- data/spec/integration/associations_spec.rb +23 -24
- data/spec/integration/attached_files_spec.rb +19 -9
- data/spec/integration/attributes_spec.rb +12 -16
- data/spec/integration/autosave_association_spec.rb +6 -6
- data/spec/integration/base_spec.rb +8 -8
- data/spec/integration/basic_contains_association_spec.rb +1 -1
- data/spec/integration/clean_connection_spec.rb +1 -1
- data/spec/integration/collection_association_spec.rb +2 -5
- data/spec/integration/date_time_properties_spec.rb +1 -17
- data/spec/integration/direct_container_spec.rb +12 -12
- data/spec/integration/directly_contains_one_association_spec.rb +11 -13
- data/spec/integration/eradicate_spec.rb +1 -1
- data/spec/integration/fedora_solr_sync_spec.rb +2 -2
- data/spec/integration/file_fixity_spec.rb +6 -8
- data/spec/integration/file_spec.rb +37 -39
- data/spec/integration/generators/solr_generator_spec.rb +7 -10
- data/spec/integration/has_and_belongs_to_many_associations_spec.rb +7 -7
- data/spec/integration/has_many_associations_spec.rb +9 -11
- data/spec/integration/indexing_spec.rb +2 -2
- data/spec/integration/indirect_container_spec.rb +11 -12
- data/spec/integration/json_serialization_spec.rb +4 -4
- data/spec/integration/query_result_builder_spec.rb +9 -21
- data/spec/integration/rdf_nested_attributes_spec.rb +7 -7
- data/spec/integration/relation_delegation_spec.rb +8 -10
- data/spec/integration/relation_spec.rb +13 -16
- data/spec/integration/scoped_query_spec.rb +3 -3
- data/spec/integration/scoping_spec.rb +3 -3
- data/spec/integration/solr_hit_spec.rb +4 -15
- data/spec/integration/versionable_spec.rb +73 -327
- data/spec/integration/with_metadata_spec.rb +1 -1
- data/spec/spec_helper.rb +52 -10
- data/spec/unit/active_fedora_spec.rb +1 -1
- data/spec/unit/aggregation/list_source_spec.rb +37 -37
- data/spec/unit/aggregation/ordered_reader_spec.rb +4 -4
- data/spec/unit/association_hash_spec.rb +17 -31
- data/spec/unit/attached_files_spec.rb +35 -32
- data/spec/unit/attributes_spec.rb +25 -25
- data/spec/unit/base_active_model_spec.rb +8 -8
- data/spec/unit/base_cma_spec.rb +1 -1
- data/spec/unit/base_extra_spec.rb +7 -22
- data/spec/unit/base_spec.rb +21 -27
- data/spec/unit/builder/has_and_belongs_to_many_spec.rb +1 -1
- data/spec/unit/callback_spec.rb +2 -2
- data/spec/unit/change_set_spec.rb +5 -5
- data/spec/unit/checksum_spec.rb +2 -2
- data/spec/unit/code_configurator_spec.rb +1 -1
- data/spec/unit/core/fedora_id_translator_spec.rb +2 -2
- data/spec/unit/core/fedora_uri_translator_spec.rb +2 -2
- data/spec/unit/core/logger_spec.rb +18 -0
- data/spec/unit/core_spec.rb +68 -32
- data/spec/unit/default_model_mapper_spec.rb +6 -6
- data/spec/unit/fedora_spec.rb +3 -4
- data/spec/unit/file_configurator_spec.rb +96 -96
- data/spec/unit/file_path_builder_spec.rb +3 -3
- data/spec/unit/file_spec.rb +93 -61
- data/spec/unit/files_hash_spec.rb +9 -9
- data/spec/unit/filter_spec.rb +3 -3
- data/spec/unit/finder_methods_spec.rb +3 -3
- data/spec/unit/forbidden_attributes_protection_spec.rb +2 -2
- data/spec/unit/has_and_belongs_to_many_association_spec.rb +14 -15
- data/spec/unit/has_many_association_spec.rb +28 -13
- data/spec/unit/indexers/global_indexer_spec.rb +6 -6
- data/spec/unit/indexing_service_spec.rb +5 -5
- data/spec/unit/indexing_spec.rb +8 -8
- data/spec/unit/inheritance_spec.rb +11 -7
- data/spec/unit/loadable_from_json_spec.rb +4 -4
- data/spec/unit/logger_spec.rb +1 -1
- data/spec/unit/model_classifier_spec.rb +5 -5
- data/spec/unit/ordered_spec.rb +144 -147
- data/spec/unit/orders/list_node_spec.rb +22 -22
- data/spec/unit/orders/ordered_list_spec.rb +96 -96
- data/spec/unit/orders/reflection_spec.rb +4 -4
- data/spec/unit/pathing_spec.rb +4 -4
- data/spec/unit/persistence_spec.rb +28 -28
- data/spec/unit/property_spec.rb +2 -2
- data/spec/unit/query_spec.rb +12 -12
- data/spec/unit/rdf/indexing_service_spec.rb +29 -29
- data/spec/unit/readonly_spec.rb +5 -4
- data/spec/unit/reflection_spec.rb +3 -3
- data/spec/unit/rspec_matchers/belong_to_associated_active_fedora_object_matcher_spec.rb +9 -9
- data/spec/unit/rspec_matchers/have_many_associated_active_fedora_objects_matcher_spec.rb +9 -9
- data/spec/unit/rspec_matchers/have_predicate_matcher_spec.rb +9 -9
- data/spec/unit/schema_indexing_strategy_spec.rb +5 -5
- data/spec/unit/serializers_spec.rb +3 -4
- data/spec/unit/solr_config_options_spec.rb +13 -16
- data/spec/unit/solr_hit_spec.rb +9 -9
- data/spec/unit/solr_service_spec.rb +4 -10
- data/spec/unit/sparql_insert_spec.rb +2 -2
- data/spec/unit/validations_spec.rb +12 -12
- data/spec/unit/with_metadata/default_metadata_class_factory_spec.rb +3 -2
- data/spec/unit/with_metadata/metadata_node_spec.rb +3 -2
- metadata +30 -130
- data/lib/active_fedora/datastreams/nokogiri_datastreams.rb +0 -119
- data/lib/active_fedora/datastreams.rb +0 -6
- data/lib/active_fedora/nom_datastream.rb +0 -73
- data/lib/active_fedora/om_datastream.rb +0 -118
- data/lib/active_fedora/profile_indexing_service.rb +0 -11
- data/lib/active_fedora/qualified_dublin_core_datastream.rb +0 -158
- data/lib/active_fedora/rdf/datastream_indexing.rb +0 -49
- data/lib/active_fedora/rdf/ntriples_rdf_datastream.rb +0 -13
- data/lib/active_fedora/rdf/rdf_datastream.rb +0 -167
- data/lib/active_fedora/rdf/rdfxml_datastream.rb +0 -13
- data/lib/active_fedora/solr_instance_loader.rb +0 -47
- data/solr/config/_rest_managed.json +0 -3
- data/solr/config/admin-extra.html +0 -31
- data/solr/config/elevate.xml +0 -36
- data/solr/config/mapping-ISOLatin1Accent.txt +0 -246
- data/solr/config/protwords.txt +0 -21
- data/solr/config/schema.xml +0 -372
- data/solr/config/scripts.conf +0 -24
- data/solr/config/solrconfig.xml +0 -311
- data/solr/config/spellings.txt +0 -2
- data/solr/config/stopwords.txt +0 -58
- data/solr/config/stopwords_en.txt +0 -58
- data/solr/config/synonyms.txt +0 -31
- data/solr/config/xslt/example.xsl +0 -132
- data/solr/config/xslt/example_atom.xsl +0 -67
- data/solr/config/xslt/example_rss.xsl +0 -66
- data/solr/config/xslt/luke.xsl +0 -337
- data/spec/fixtures/damsObjectModel.xml +0 -38
- data/spec/fixtures/dublin_core_rdf_descMetadata.nt +0 -13
- data/spec/fixtures/mixed_rdf_descMetadata.nt +0 -7
- data/spec/fixtures/mods_articles/mods_article1.xml +0 -98
- data/spec/fixtures/solr_rdf_descMetadata.nt +0 -7
- data/spec/integration/complex_rdf_datastream_spec.rb +0 -228
- data/spec/integration/datastream_rdf_nested_attributes_spec.rb +0 -179
- data/spec/integration/ntriples_datastream_spec.rb +0 -203
- data/spec/integration/om_datastream_spec.rb +0 -78
- data/spec/integration/solr_instance_loader_spec.rb +0 -156
- data/spec/samples/hydra-mods_article_datastream.rb +0 -517
- data/spec/samples/models/mods_article.rb +0 -9
- data/spec/samples/oral_history_sample.xml +0 -38
- data/spec/samples/oral_history_xml.xml +0 -35
- data/spec/samples/samples.rb +0 -2
- data/spec/unit/nom_datastream_spec.rb +0 -60
- data/spec/unit/ntriples_datastream_spec.rb +0 -170
- data/spec/unit/om_datastream_spec.rb +0 -294
- data/spec/unit/qualified_dublin_core_datastream_spec.rb +0 -119
- data/spec/unit/rdf_datastream_spec.rb +0 -84
- data/spec/unit/rdf_resource_datastream_spec.rb +0 -204
- data/spec/unit/rdfxml_datastream_spec.rb +0 -106
|
@@ -3,27 +3,27 @@ require 'spec_helper'
|
|
|
3
3
|
describe ActiveFedora::Persistence do
|
|
4
4
|
describe '#new_record?' do
|
|
5
5
|
context 'with an new object' do
|
|
6
|
-
subject { ActiveFedora::Base.new }
|
|
6
|
+
subject(:persistence) { ActiveFedora::Base.new }
|
|
7
7
|
it { is_expected.to be_new_record }
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
context 'with an destroyed object' do
|
|
11
|
-
subject { ActiveFedora::Base.create }
|
|
12
|
-
before {
|
|
11
|
+
subject(:persistence) { ActiveFedora::Base.create }
|
|
12
|
+
before { persistence.delete }
|
|
13
13
|
it { is_expected.not_to be_new_record }
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
describe '.delete' do
|
|
18
18
|
context 'with an unsaved object' do
|
|
19
|
-
subject { ActiveFedora::Base.new }
|
|
20
|
-
before {
|
|
21
|
-
it { is_expected.to eq
|
|
19
|
+
subject(:persistence) { ActiveFedora::Base.new }
|
|
20
|
+
before { persistence.delete }
|
|
21
|
+
it { is_expected.to eq persistence }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
context 'with a saved object' do
|
|
25
|
-
subject { ActiveFedora::Base.create! }
|
|
26
|
-
before {
|
|
25
|
+
subject(:persistence) { ActiveFedora::Base.create! }
|
|
26
|
+
before { persistence.delete }
|
|
27
27
|
it { is_expected.to be_frozen }
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -46,68 +46,68 @@ describe ActiveFedora::Persistence do
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
describe '.destroy' do
|
|
49
|
-
subject { ActiveFedora::Base.create! }
|
|
49
|
+
subject(:persistence) { ActiveFedora::Base.create! }
|
|
50
50
|
context 'with no options' do
|
|
51
|
-
before {
|
|
51
|
+
before { persistence.destroy }
|
|
52
52
|
it 'does not clear the id' do
|
|
53
|
-
expect(
|
|
53
|
+
expect(persistence.id).not_to be_nil
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
context 'with option eradicate: true' do
|
|
58
58
|
it 'deletes the tombstone' do
|
|
59
|
-
expect(
|
|
60
|
-
|
|
59
|
+
expect(persistence.class).to receive(:eradicate).with(persistence.id).and_return(true)
|
|
60
|
+
persistence.destroy(eradicate: true)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
describe "save" do
|
|
66
|
-
subject { ActiveFedora::Base.new }
|
|
66
|
+
subject(:persistence) { ActiveFedora::Base.new }
|
|
67
67
|
|
|
68
68
|
context "when called with option update_index: false" do
|
|
69
69
|
context "on a new record" do
|
|
70
70
|
it "does not update the index" do
|
|
71
|
-
expect(
|
|
72
|
-
|
|
71
|
+
expect(persistence).to_not receive(:update_index)
|
|
72
|
+
persistence.save(update_index: false)
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
context "on a persisted record" do
|
|
77
77
|
before do
|
|
78
|
-
allow(
|
|
78
|
+
allow(persistence).to receive(:new_record?) { false }
|
|
79
79
|
allow_any_instance_of(Ldp::Orm).to receive(:save) { true }
|
|
80
|
-
allow(
|
|
80
|
+
allow(persistence).to receive(:update_modified_date)
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
it "does not update the index" do
|
|
84
|
-
expect(
|
|
85
|
-
|
|
84
|
+
expect(persistence).to_not receive(:update_index)
|
|
85
|
+
persistence.save(update_index: false)
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
context "when called with option :update_index=>true" do
|
|
91
91
|
context "on create" do
|
|
92
|
-
before { allow(
|
|
92
|
+
before { allow(persistence).to receive(:create_needs_index?) { false } }
|
|
93
93
|
|
|
94
94
|
it "does not override `create_needs_index?'" do
|
|
95
|
-
expect(
|
|
96
|
-
|
|
95
|
+
expect(persistence).to_not receive(:update_index)
|
|
96
|
+
persistence.save(update_index: true)
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
context "on update" do
|
|
101
101
|
before do
|
|
102
|
-
allow(
|
|
102
|
+
allow(persistence).to receive(:new_record?) { false }
|
|
103
103
|
allow_any_instance_of(Ldp::Orm).to receive(:save) { true }
|
|
104
|
-
allow(
|
|
105
|
-
allow(
|
|
104
|
+
allow(persistence).to receive(:update_needs_index?) { false }
|
|
105
|
+
allow(persistence).to receive(:update_modified_date)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
it "does not override `update_needs_index?'" do
|
|
109
|
-
expect(
|
|
110
|
-
|
|
109
|
+
expect(persistence).to_not receive(:update_index)
|
|
110
|
+
persistence.save(update_index: true)
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
end
|
data/spec/unit/property_spec.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe ActiveFedora::Property do
|
|
4
|
-
before
|
|
5
|
-
@test_property = described_class.new(
|
|
4
|
+
before do
|
|
5
|
+
@test_property = described_class.new(instance_double(ActiveFedora::Base), "file_name", :string)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it 'provides .new' do
|
data/spec/unit/query_spec.rb
CHANGED
|
@@ -8,7 +8,7 @@ describe ActiveFedora::Base do
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
let(:sort_query) { ActiveFedora.index_field_mapper.solr_name("system_create", :stored_sortable, type: :date) + ' asc' }
|
|
11
|
-
let(:model_query) { "_query_:\"{!
|
|
11
|
+
let(:model_query) { "_query_:\"{!raw f=has_model_ssim}SpecModel::Basic\"" }
|
|
12
12
|
|
|
13
13
|
after(:all) do
|
|
14
14
|
Object.send(:remove_const, :SpecModel)
|
|
@@ -128,9 +128,9 @@ describe ActiveFedora::Base do
|
|
|
128
128
|
.and_return('response' => { 'docs' => mock_docs })
|
|
129
129
|
|
|
130
130
|
allow(relation).to receive(:load_from_fedora).with("changeme-30", nil)
|
|
131
|
-
.and_return(SpecModel::Basic.new('changeme-30'))
|
|
131
|
+
.and_return(SpecModel::Basic.new(id: 'changeme-30'))
|
|
132
132
|
allow(relation).to receive(:load_from_fedora).with("changeme-22", nil)
|
|
133
|
-
.and_return(SpecModel::Basic.new('changeme-22'))
|
|
133
|
+
.and_return(SpecModel::Basic.new(id: 'changeme-22'))
|
|
134
134
|
SpecModel::Basic.find_each { |obj| obj.class == SpecModel::Basic }
|
|
135
135
|
end
|
|
136
136
|
|
|
@@ -144,8 +144,8 @@ describe ActiveFedora::Base do
|
|
|
144
144
|
let(:mock_docs) { [{ "id" => "changeme-30" }, { "id" => "changeme-22" }] }
|
|
145
145
|
|
|
146
146
|
it "filters by the provided fields" do
|
|
147
|
-
expect(relation).to receive(:load_from_fedora).with("changeme-30", nil).and_return(SpecModel::Basic.new('changeme-30'))
|
|
148
|
-
expect(relation).to receive(:load_from_fedora).with("changeme-22", nil).and_return(SpecModel::Basic.new('changeme-22'))
|
|
147
|
+
expect(relation).to receive(:load_from_fedora).with("changeme-30", nil).and_return(SpecModel::Basic.new(id: 'changeme-30'))
|
|
148
|
+
expect(relation).to receive(:load_from_fedora).with("changeme-22", nil).and_return(SpecModel::Basic.new(id: 'changeme-22'))
|
|
149
149
|
|
|
150
150
|
expect(mock_docs).to receive(:has_next?).and_return(false)
|
|
151
151
|
expect(solr).to receive(:paginate).with(1, 1000, 'select', expected_params).and_return('response' => { 'docs' => mock_docs })
|
|
@@ -244,7 +244,7 @@ describe ActiveFedora::Base do
|
|
|
244
244
|
describe '#search_with_conditions' do
|
|
245
245
|
let(:mock_result) { double('Result') }
|
|
246
246
|
let(:klass) { SpecModel::Basic }
|
|
247
|
-
subject { klass.search_with_conditions(conditions) }
|
|
247
|
+
subject(:search_with_conditions) { klass.search_with_conditions(conditions) }
|
|
248
248
|
|
|
249
249
|
before do
|
|
250
250
|
expect(ActiveFedora::SolrService).to receive(:query)
|
|
@@ -259,7 +259,7 @@ describe ActiveFedora::Base do
|
|
|
259
259
|
let(:conditions) { { foo: 'bar', baz: ['quix', 'quack'] } }
|
|
260
260
|
|
|
261
261
|
it "makes a query to solr and returns the results" do
|
|
262
|
-
expect(
|
|
262
|
+
expect(search_with_conditions).to eq mock_result
|
|
263
263
|
end
|
|
264
264
|
end
|
|
265
265
|
|
|
@@ -271,7 +271,7 @@ describe ActiveFedora::Base do
|
|
|
271
271
|
let(:conditions) { { foo: '9" Nails', baz: ['7" version', 'quack'] } }
|
|
272
272
|
|
|
273
273
|
it "escapes quotes" do
|
|
274
|
-
expect(
|
|
274
|
+
expect(search_with_conditions).to eq mock_result
|
|
275
275
|
end
|
|
276
276
|
end
|
|
277
277
|
|
|
@@ -282,7 +282,7 @@ describe ActiveFedora::Base do
|
|
|
282
282
|
let(:conditions) { { baz: 'quack' } }
|
|
283
283
|
let(:expected_query) { "_query_:\"{!field f=baz}quack\"" }
|
|
284
284
|
it "doesn't use the class if it's called on AF:Base " do
|
|
285
|
-
expect(
|
|
285
|
+
expect(search_with_conditions).to eq mock_result
|
|
286
286
|
end
|
|
287
287
|
end
|
|
288
288
|
|
|
@@ -290,7 +290,7 @@ describe ActiveFedora::Base do
|
|
|
290
290
|
let(:conditions) { 'chunky:monkey' }
|
|
291
291
|
let(:expected_query) { '(chunky:monkey)' }
|
|
292
292
|
it "uses the query string if it's provided and wrap it in parentheses" do
|
|
293
|
-
expect(
|
|
293
|
+
expect(search_with_conditions).to eq mock_result
|
|
294
294
|
end
|
|
295
295
|
end
|
|
296
296
|
end
|
|
@@ -298,10 +298,10 @@ describe ActiveFedora::Base do
|
|
|
298
298
|
|
|
299
299
|
describe "#load_from_fedora" do
|
|
300
300
|
let(:relation) { ActiveFedora::Relation.new(described_class) }
|
|
301
|
-
before { @obj = SpecModel::Basic.create(id: "
|
|
301
|
+
before { @obj = SpecModel::Basic.create(id: "test_123") }
|
|
302
302
|
after { @obj.destroy }
|
|
303
303
|
it "casts when klass == ActiveFedora::Base and cast argument is nil" do
|
|
304
|
-
expect(relation.send(:load_from_fedora, "
|
|
304
|
+
expect(relation.send(:load_from_fedora, "test_123", nil)).to be_a SpecModel::Basic
|
|
305
305
|
end
|
|
306
306
|
end
|
|
307
307
|
end
|
|
@@ -2,28 +2,28 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe ActiveFedora::RDF::IndexingService do
|
|
4
4
|
before do
|
|
5
|
-
class
|
|
5
|
+
class MyObj < ActiveFedora::Base
|
|
6
6
|
property :created, predicate: ::RDF::Vocab::DC.created
|
|
7
7
|
property :title, predicate: ::RDF::Vocab::DC.title
|
|
8
8
|
property :publisher, predicate: ::RDF::Vocab::DC.publisher
|
|
9
|
-
property :based_near, predicate: ::RDF::FOAF.based_near
|
|
10
|
-
property :related_url, predicate: ::RDF::RDFS.seeAlso
|
|
9
|
+
property :based_near, predicate: ::RDF::Vocab::FOAF.based_near
|
|
10
|
+
property :related_url, predicate: ::RDF::Vocab::RDFS.seeAlso
|
|
11
11
|
property :rights, predicate: ::RDF::Vocab::DC.rights
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
after do
|
|
16
|
-
Object.send(:remove_const, :
|
|
16
|
+
Object.send(:remove_const, :MyObj)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
let(:f2) do
|
|
20
|
-
|
|
21
|
-
obj.created = Date.parse("2012-03-04")
|
|
22
|
-
obj.title = "Of Mice and Men, The Sequel"
|
|
23
|
-
obj.publisher = "Bob's Blogtastic Publishing"
|
|
20
|
+
MyObj.new.tap do |obj|
|
|
21
|
+
obj.created = [Date.parse("2012-03-04")]
|
|
22
|
+
obj.title = ["Of Mice and Men, The Sequel"]
|
|
23
|
+
obj.publisher = [RDF::Literal.new("Bob's Blogtastic Publishing", language: :fr)]
|
|
24
24
|
obj.based_near = ["Tacoma, WA", "Renton, WA"]
|
|
25
|
-
obj.related_url = "http://example.org/blogtastic/"
|
|
26
|
-
obj.rights = "Totally open, y'all"
|
|
25
|
+
obj.related_url = ["http://example.org/blogtastic/"]
|
|
26
|
+
obj.rights = ["Totally open, y'all"]
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -51,33 +51,33 @@ describe ActiveFedora::RDF::IndexingService do
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
before do
|
|
54
|
-
allow(
|
|
54
|
+
allow(MyObj).to receive(:index_config).and_return(index_config)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
let(:indexer) { described_class.new(f2) }
|
|
58
58
|
|
|
59
59
|
describe "#generate_solr_document" do
|
|
60
|
-
|
|
60
|
+
let(:solr_obj) { indexer.generate_solr_document(lambda { |key| "solr_rdf__#{key}" }) }
|
|
61
61
|
it "returns the right fields" do
|
|
62
|
-
expect(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
expect(solr_obj.keys).to include(ActiveFedora.index_field_mapper.solr_name("solr_rdf__related_url", type: :string),
|
|
63
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", type: :string),
|
|
64
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", :sortable),
|
|
65
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", :facetable),
|
|
66
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__created", :sortable, type: :date),
|
|
67
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__created", :displayable),
|
|
68
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__title", type: :string),
|
|
69
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__title", :sortable),
|
|
70
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__based_near", type: :string),
|
|
71
|
+
ActiveFedora.index_field_mapper.solr_name("solr_rdf__based_near", :facetable))
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
it "returns the right values" do
|
|
75
|
-
expect(
|
|
76
|
-
expect(
|
|
77
|
-
expect(
|
|
78
|
-
expect(
|
|
79
|
-
expect(
|
|
80
|
-
expect(
|
|
75
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__related_url", type: :string)]).to eq ["http://example.org/blogtastic/"]
|
|
76
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__based_near", type: :string)]).to contain_exactly "Tacoma, WA", "Renton, WA"
|
|
77
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__based_near", :facetable)]).to contain_exactly "Tacoma, WA", "Renton, WA"
|
|
78
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", type: :string)]).to eq ["Bob's Blogtastic Publishing"]
|
|
79
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", :sortable)]).to eq "Bob's Blogtastic Publishing"
|
|
80
|
+
expect(solr_obj[ActiveFedora.index_field_mapper.solr_name("solr_rdf__publisher", :facetable)]).to eq ["Bob's Blogtastic Publishing"]
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -90,7 +90,7 @@ describe ActiveFedora::RDF::IndexingService do
|
|
|
90
90
|
|
|
91
91
|
it "returns the right values" do
|
|
92
92
|
expect(fields["related_url"].values).to eq ["http://example.org/blogtastic/"]
|
|
93
|
-
expect(fields["based_near"].values).to
|
|
93
|
+
expect(fields["based_near"].values).to contain_exactly "Tacoma, WA", "Renton, WA"
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
it "returns the right type information" do
|
data/spec/unit/readonly_spec.rb
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe ActiveFedora::Base do
|
|
4
|
+
subject(:object) { described_class.new }
|
|
4
5
|
it { is_expected.not_to be_readonly }
|
|
5
6
|
|
|
6
7
|
describe "#readonly!" do
|
|
7
8
|
it "makes the object readonly" do
|
|
8
|
-
expect {
|
|
9
|
+
expect { object.readonly! }.to change { object.readonly? }.from(false).to(true)
|
|
9
10
|
end
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
context "a readonly record" do
|
|
13
|
-
before {
|
|
14
|
+
before { object.readonly! }
|
|
14
15
|
|
|
15
16
|
it "does not be destroyable" do
|
|
16
|
-
expect {
|
|
17
|
+
expect { object.destroy }.to raise_error ActiveFedora::ReadOnlyRecord
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
it "does not be mutable" do
|
|
20
|
-
expect {
|
|
21
|
+
expect { object.save }.to raise_error ActiveFedora::ReadOnlyRecord
|
|
21
22
|
end
|
|
22
23
|
end
|
|
23
24
|
end
|
|
@@ -4,14 +4,14 @@ describe ActiveFedora::Reflection::AssociationReflection do
|
|
|
4
4
|
describe "#derive_foreign_key" do
|
|
5
5
|
let(:name) { 'dummy' }
|
|
6
6
|
let(:options) { { inverse_of: :default_permissions } }
|
|
7
|
-
let(:active_fedora) {
|
|
7
|
+
let(:active_fedora) { instance_double(ActiveFedora::Base) }
|
|
8
8
|
subject { instance.send :derive_foreign_key }
|
|
9
9
|
|
|
10
10
|
context "when a has_many" do
|
|
11
11
|
let(:instance) { ActiveFedora::Reflection::HasManyReflection.new(name, nil, options, active_fedora) }
|
|
12
12
|
|
|
13
13
|
context "and the inverse is a collection association" do
|
|
14
|
-
let(:inverse) {
|
|
14
|
+
let(:inverse) { instance_double(ActiveFedora::Reflection::HasAndBelongsToManyReflection, collection?: true) }
|
|
15
15
|
before { allow(instance).to receive(:inverse_of).and_return(inverse) }
|
|
16
16
|
it { is_expected.to eq 'default_permission_ids' }
|
|
17
17
|
end
|
|
@@ -28,7 +28,7 @@ describe ActiveFedora::Reflection::AssociationReflection do
|
|
|
28
28
|
after { Object.send(:remove_const, :Dummy) }
|
|
29
29
|
let(:name) { 'dummy' }
|
|
30
30
|
let(:options) { { as: 'foothing' } }
|
|
31
|
-
let(:active_fedora) {
|
|
31
|
+
let(:active_fedora) { instance_double(ActiveFedora::Base) }
|
|
32
32
|
subject { instance.send :automatic_inverse_of }
|
|
33
33
|
|
|
34
34
|
context "when a has_many" do
|
|
@@ -3,30 +3,30 @@ require 'ostruct'
|
|
|
3
3
|
require "active_fedora/rspec_matchers/belong_to_associated_active_fedora_object_matcher"
|
|
4
4
|
|
|
5
5
|
describe RSpec::Matchers, ".belong_to_associated_active_fedora_object" do
|
|
6
|
-
|
|
6
|
+
let(:open_struct) { OpenStruct.new(id: id) }
|
|
7
7
|
let(:id) { 123 }
|
|
8
8
|
let(:object1) { Object.new }
|
|
9
9
|
let(:object2) { Object.new }
|
|
10
10
|
let(:association) { :association }
|
|
11
11
|
|
|
12
12
|
it 'matches when association is properly stored in fedora' do
|
|
13
|
-
expect(
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
13
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
14
|
+
expect(open_struct).to receive(association).and_return(object1)
|
|
15
|
+
expect(open_struct).to belong_to_associated_active_fedora_object(association).with_object(object1)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
it 'does not match when association is different' do
|
|
19
|
-
expect(
|
|
20
|
-
expect(
|
|
19
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
20
|
+
expect(open_struct).to receive(association).and_return(object1)
|
|
21
21
|
expect {
|
|
22
|
-
expect(
|
|
22
|
+
expect(open_struct).to belong_to_associated_active_fedora_object(association).with_object(object2)
|
|
23
23
|
}.to raise_error RSpec::Expectations::ExpectationNotMetError,
|
|
24
|
-
/expected #{
|
|
24
|
+
/expected #{open_struct.class} ID=#{id} association: #{association.inspect}/
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
it 'requires :with_object option' do
|
|
28
28
|
expect {
|
|
29
|
-
expect(
|
|
29
|
+
expect(open_struct).to belong_to_associated_active_fedora_object(association)
|
|
30
30
|
}.to(
|
|
31
31
|
raise_error(
|
|
32
32
|
ArgumentError,
|
|
@@ -3,7 +3,7 @@ require 'ostruct'
|
|
|
3
3
|
require "active_fedora/rspec_matchers/have_many_associated_active_fedora_objects_matcher"
|
|
4
4
|
|
|
5
5
|
describe RSpec::Matchers, ".have_many_associated_active_fedora_objects" do
|
|
6
|
-
|
|
6
|
+
let(:open_struct) { OpenStruct.new(id: id) }
|
|
7
7
|
let(:id) { 123 }
|
|
8
8
|
let(:object1) { Object.new }
|
|
9
9
|
let(:object2) { Object.new }
|
|
@@ -11,23 +11,23 @@ describe RSpec::Matchers, ".have_many_associated_active_fedora_objects" do
|
|
|
11
11
|
let(:association) { :association }
|
|
12
12
|
|
|
13
13
|
it 'matches when association is properly stored in fedora' do
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
16
|
-
expect(
|
|
14
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
15
|
+
expect(open_struct).to receive(association).and_return([object1, object2])
|
|
16
|
+
expect(open_struct).to have_many_associated_active_fedora_objects(association).with_objects([object1, object2])
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'does not match when association is different' do
|
|
20
|
-
expect(
|
|
21
|
-
expect(
|
|
20
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
21
|
+
expect(open_struct).to receive(association).and_return([object1, object3])
|
|
22
22
|
expect {
|
|
23
|
-
expect(
|
|
23
|
+
expect(open_struct).to have_many_associated_active_fedora_objects(association).with_objects([object1, object2])
|
|
24
24
|
}.to raise_error RSpec::Expectations::ExpectationNotMetError,
|
|
25
|
-
/expected #{
|
|
25
|
+
/expected #{open_struct.class} ID=#{id} association: #{association.inspect}/
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
it 'requires :with_objects option' do
|
|
29
29
|
expect {
|
|
30
|
-
expect(
|
|
30
|
+
expect(open_struct).to have_many_associated_active_fedora_objects(association)
|
|
31
31
|
}.to(
|
|
32
32
|
raise_error(
|
|
33
33
|
ArgumentError,
|
|
@@ -3,7 +3,7 @@ require 'ostruct'
|
|
|
3
3
|
require "active_fedora/rspec_matchers/have_predicate_matcher"
|
|
4
4
|
|
|
5
5
|
describe RSpec::Matchers, ".have_predicate" do
|
|
6
|
-
|
|
6
|
+
let(:open_struct) { OpenStruct.new(id: id) }
|
|
7
7
|
let(:id) { 123 }
|
|
8
8
|
let(:object1) { Object.new }
|
|
9
9
|
let(:object2) { Object.new }
|
|
@@ -11,23 +11,23 @@ describe RSpec::Matchers, ".have_predicate" do
|
|
|
11
11
|
let(:predicate) { :predicate }
|
|
12
12
|
|
|
13
13
|
it 'matches when relationship is "what we have in Fedora"' do
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
16
|
-
expect(
|
|
14
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
15
|
+
expect(open_struct).to receive(:relationships).with(predicate).and_return([object1, object2])
|
|
16
|
+
expect(open_struct).to have_predicate(predicate).with_objects([object1, object2])
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'does not match when relationship is different' do
|
|
20
|
-
expect(
|
|
21
|
-
expect(
|
|
20
|
+
expect(open_struct.class).to receive(:find).with(id).and_return(open_struct)
|
|
21
|
+
expect(open_struct).to receive(:relationships).with(predicate).and_return([object1, object3])
|
|
22
22
|
expect {
|
|
23
|
-
expect(
|
|
23
|
+
expect(open_struct).to have_predicate(predicate).with_objects([object1, object2])
|
|
24
24
|
}.to raise_error RSpec::Expectations::ExpectationNotMetError,
|
|
25
|
-
/expected #{
|
|
25
|
+
/expected #{open_struct.class} ID=#{id} relationship: #{predicate.inspect}/
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
it 'requires :with_objects option' do
|
|
29
29
|
expect {
|
|
30
|
-
expect(
|
|
30
|
+
expect(open_struct).to have_predicate(predicate)
|
|
31
31
|
}.to(
|
|
32
32
|
raise_error(
|
|
33
33
|
ArgumentError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
RSpec.describe ActiveFedora::SchemaIndexingStrategy do
|
|
4
|
-
subject { described_class.new(property_indexer_factory) }
|
|
4
|
+
subject(:index_strategy) { described_class.new(property_indexer_factory) }
|
|
5
5
|
|
|
6
6
|
describe "#apply" do
|
|
7
7
|
let(:property) do
|
|
@@ -40,9 +40,9 @@ RSpec.describe ActiveFedora::SchemaIndexingStrategy do
|
|
|
40
40
|
end
|
|
41
41
|
let(:index_types) {}
|
|
42
42
|
context "with no index types" do
|
|
43
|
-
subject { described_class.new }
|
|
43
|
+
subject(:index_strategy) { described_class.new }
|
|
44
44
|
it "does not try to index it" do
|
|
45
|
-
|
|
45
|
+
index_strategy.apply(object, property)
|
|
46
46
|
|
|
47
47
|
expect(object).to have_received(:property).with(property.name, property.to_h)
|
|
48
48
|
expect(index_configuration).not_to have_received(:as)
|
|
@@ -51,7 +51,7 @@ RSpec.describe ActiveFedora::SchemaIndexingStrategy do
|
|
|
51
51
|
context "with one index type" do
|
|
52
52
|
let(:index_types) { :symbol }
|
|
53
53
|
it "applies that one" do
|
|
54
|
-
|
|
54
|
+
index_strategy.apply(object, property)
|
|
55
55
|
|
|
56
56
|
expect(index_configuration).to have_received(:as).with(:symbol)
|
|
57
57
|
end
|
|
@@ -59,7 +59,7 @@ RSpec.describe ActiveFedora::SchemaIndexingStrategy do
|
|
|
59
59
|
context "with multiple index types" do
|
|
60
60
|
let(:index_types) { [:symbol, :stored_searchable] }
|
|
61
61
|
it "applies all of them" do
|
|
62
|
-
|
|
62
|
+
index_strategy.apply(object, property)
|
|
63
63
|
|
|
64
64
|
expect(index_configuration).to have_received(:as).with(:symbol, :stored_searchable)
|
|
65
65
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe ActiveFedora::Attributes::Serializers do
|
|
4
|
-
subject { ActiveFedora::Base }
|
|
5
4
|
describe "deserialize_dates_from_form" do
|
|
6
5
|
before do
|
|
7
6
|
class Foo < ActiveFedora::Base
|
|
@@ -11,10 +10,10 @@ describe ActiveFedora::Attributes::Serializers do
|
|
|
11
10
|
after do
|
|
12
11
|
Object.send(:remove_const, :Foo)
|
|
13
12
|
end
|
|
14
|
-
subject { Foo.new }
|
|
13
|
+
subject(:serializer) { Foo.new }
|
|
15
14
|
it "deserializes dates" do
|
|
16
|
-
|
|
17
|
-
expect(
|
|
15
|
+
serializer.attributes = { 'birthday(1i)' => '2012', 'birthday(2i)' => '10', 'birthday(3i)' => '31' }
|
|
16
|
+
expect(serializer.birthday).to eq '2012-10-31'
|
|
18
17
|
end
|
|
19
18
|
end
|
|
20
19
|
end
|
|
@@ -8,9 +8,7 @@ describe ActiveFedora do
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
@test_object = ActiveFedora::Base.new
|
|
13
|
-
end
|
|
11
|
+
subject(:test_object) { ActiveFedora::Base.new }
|
|
14
12
|
|
|
15
13
|
describe ".id_field" do
|
|
16
14
|
let(:field) { "MY_SAMPLE_ID".freeze }
|
|
@@ -19,15 +17,15 @@ describe ActiveFedora do
|
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
it "is used by ActiveFedora::Base.to_solr" do
|
|
22
|
-
allow(
|
|
23
|
-
expect(
|
|
24
|
-
expect(
|
|
20
|
+
allow(test_object).to receive(:id).and_return('changeme:123')
|
|
21
|
+
expect(test_object.to_solr[field.to_sym]).to eq 'changeme:123'
|
|
22
|
+
expect(test_object.to_solr[:id]).to be_nil
|
|
25
23
|
end
|
|
26
24
|
|
|
27
25
|
it "is used by ActiveFedora::Base#search_with_conditions" do
|
|
28
26
|
mock_response = double("SolrResponse")
|
|
29
27
|
expect(ActiveFedora::SolrService).to receive(:query)
|
|
30
|
-
.with("_query_:\"{!
|
|
28
|
+
.with("_query_:\"{!raw f=has_model_ssim}SolrSpecModel::Basic\" AND " \
|
|
31
29
|
"_query_:\"{!field f=#{field}}changeme:30\"",
|
|
32
30
|
sort: ["#{described_class.index_field_mapper.solr_name('system_create', :stored_sortable, type: :date)} asc"])
|
|
33
31
|
.and_return(mock_response)
|
|
@@ -43,17 +41,16 @@ describe ActiveFedora do
|
|
|
43
41
|
end
|
|
44
42
|
|
|
45
43
|
it "prevents Base.save from calling update_index if false" do
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
expect(@test_object).to receive(:refresh)
|
|
51
|
-
@test_object.save
|
|
44
|
+
allow(test_object).to receive(:new_record?).and_return(false)
|
|
45
|
+
expect(test_object).to receive(:update_index).never
|
|
46
|
+
expect(test_object).to receive(:refresh)
|
|
47
|
+
test_object.save
|
|
52
48
|
end
|
|
49
|
+
|
|
53
50
|
it "prevents Base.delete from deleting the corresponding Solr document if false" do
|
|
54
|
-
expect(ActiveFedora::SolrService.instance.conn).to receive(:delete).with(
|
|
55
|
-
expect(
|
|
56
|
-
|
|
51
|
+
expect(ActiveFedora::SolrService.instance.conn).to receive(:delete).with(test_object.id).never
|
|
52
|
+
expect(test_object).to receive(:delete)
|
|
53
|
+
test_object.delete
|
|
57
54
|
end
|
|
58
55
|
end
|
|
59
56
|
end
|