Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Deprecate add_constituent #515

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-03-13 09:02:40 -0400 using RuboCop version 0.65.0.
# on 2019-03-13 11:39:01 -0500 using RuboCop version 0.65.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -90,7 +90,7 @@ Metrics/MethodLength:
# Offense count: 3
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 147
Max: 148

# Offense count: 2
# Configuration parameters: CountKeywordArgs.
Expand Down Expand Up @@ -243,7 +243,7 @@ RSpec/DescribeClass:
RSpec/ExampleLength:
Enabled: false

# Offense count: 44
# Offense count: 45
RSpec/ExpectInHook:
Exclude:
- 'spec/datastreams/content_metadata_ds_spec.rb'
Expand Down Expand Up @@ -277,7 +277,7 @@ RSpec/MessageChain:
Exclude:
- 'spec/services/suri_service_spec.rb'

# Offense count: 275
# Offense count: 276
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand Down
2 changes: 1 addition & 1 deletion lib/dor/models/concerns/contentable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def decommission(tag)
TagService.add self, "Decommissioned : #{tag}"
end

# TODO: Move to Dor-Utils.
# Adds a RELS-EXT constituent relationship to the given druid
# @param [String] druid the parent druid of the constituent relationship
# e.g.: <fedora:isConstituentOf rdf:resource="info:fedora/druid:hj097bm8879" />
def add_constituent(druid)
add_relationship :is_constituent_of, ActiveFedora::Base.find(druid)
end
deprecation_deprecate add_constituent: 'Use add_relationship :is_constituent_of instead'
end
end
1 change: 1 addition & 0 deletions spec/models/concerns/contentable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def internal_uri
end

before do
expect(Deprecation).to receive(:warn)
allow(ActiveFedora::Base).to receive(:find) { child_obj }
end

Expand Down