Skip to content

Commit

Permalink
Merge 12b8962 into 7150841
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey Pendragon committed Mar 16, 2016
2 parents 7150841 + 12b8962 commit 7c6ea24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_fedora/persistence.rb
Expand Up @@ -205,7 +205,7 @@ def assign_uri_to_contained_resources

def save_contained_resources
contained_resources.changed.each do |_, resource|
resource.save
resource.save(container: self)
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/integration/contains_association_spec.rb
Expand Up @@ -16,7 +16,9 @@ class Source < ActiveFedora::Base
s = Source.new
s.sub_resource.title = "Test"
expect(s.sub_resource).not_to be_persisted
allow(s.sub_resource).to receive(:save).and_call_original
expect { s.save }.not_to raise_error
expect(s.sub_resource).to have_received(:save).with(container: s)
s.reload
expect(s.sub_resource.title).to eq "Test"
expect(s.sub_resource.uri).to eq s.uri.to_s + "/sub_resource"
Expand Down

0 comments on commit 7c6ea24

Please sign in to comment.