Skip to content

Commit

Permalink
Removed code that is duplicated by curation_concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 7, 2015
1 parent 2796fa2 commit 8cdf984
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 51 deletions.
2 changes: 2 additions & 0 deletions spec/forms/collection_form_spec.rb
Expand Up @@ -15,6 +15,8 @@
:date_created,
:subject,
:language,
:representative_id,
:thumbnail_id,
:identifier,
:based_near,
:related_url] }
Expand Down
18 changes: 0 additions & 18 deletions spec/models/collection_spec.rb
Expand Up @@ -17,22 +17,4 @@
collection.title = nil
expect(collection).not_to be_valid
end

describe "::bytes" do
subject { collection.bytes }

context "with no items" do
before { collection.save }
it { is_expected.to eq 0 }
end

context "with two 50 byte files" do
let(:bitstream) { double("content", size: "50") }
let(:file) { mock_model FileSet, content: bitstream }

before { allow(collection).to receive(:members).and_return([file, file]) }

it { is_expected.to eq 100 }
end
end
end
9 changes: 0 additions & 9 deletions sufia-models/app/models/concerns/sufia/collection_behavior.rb
@@ -1,9 +1,6 @@
module Sufia
module CollectionBehavior
extend ActiveSupport::Concern
include Hydra::Collection
include Sufia::ModelMethods
include Sufia::Noid

included do
before_save :update_permissions
Expand All @@ -13,11 +10,5 @@ module CollectionBehavior
def update_permissions
self.visibility = "open"
end

# Compute the sum of each file in the collection
# Return an integer of the result
def bytes
members.reduce(0) { |sum, fs| sum + fs.content.size.to_i }
end
end
end
19 changes: 0 additions & 19 deletions sufia-models/app/models/concerns/sufia/model_methods.rb

This file was deleted.

5 changes: 0 additions & 5 deletions sufia-models/app/models/sufia/collection.rb

This file was deleted.

0 comments on commit 8cdf984

Please sign in to comment.