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

Commit

Permalink
Deprecate add_constituent
Browse files Browse the repository at this point in the history
This was only used by dor-utils and we've stopped using it there:
sul-dlss-deprecated/dor-utils#41
  • Loading branch information
jcoyne committed Mar 13, 2019
1 parent 397638f commit 2c3cbb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit 2c3cbb3

Please sign in to comment.