Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Makes terms_for_display accesible on Worthwhile::GenericFile #36

Merged
merged 1 commit into from
Nov 12, 2014

Conversation

flyingzumwalt
Copy link
Contributor

This is so that the :title attribute (along with any other terms) on GenericFile create/update form actually gets applied to the GenericFile object

refs #34

@@ -11,7 +11,7 @@ module GenericFileBase
include Sufia::GenericFile::Derivatives
include Sufia::GenericFile::Metadata
include Sufia::GenericFile::Versions
include Sufia::Permissions::Readable
include Sufia::GenericFile::Permissions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want Sufia::GenericFile::Permissions because that introduces methods that overwrite Hydra::AccessControls::Permissions

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.12%) when pulling c95ceef on generic_file_title_accesible into d56537e on master.

@flyingzumwalt flyingzumwalt force-pushed the generic_file_title_accesible branch from c95ceef to 946e4d4 Compare November 11, 2014 15:02
@@ -5,6 +5,11 @@
subject.depositor = '[email protected]'
end

it "should update attributes" do
subject.attributes = {title:"My new Title"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a deprecation warning:

.DEPRECATION WARNING: You attempted to set the attribute `title' on `Worthwhile::GenericFile' to a scalar value. However, this attribute is declared as being multivalued. This behavior is deprecated and will raise an ArgumentError in active-fedora 8.0.0. (called from block in attributes= at /home/travis/.rvm/gems/ruby-2.1.4/gems/active-fedora-7.1.1/lib/active_fedora/attributes.rb:21)

Can you set it to an array instead?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 946e4d4 on generic_file_title_accesible into d56537e on master.

@@ -132,10 +132,11 @@
end

context "updating metadata" do
it "should be successful" do
it "should be successful and update attributes" do
post :update, id: generic_file, generic_file:
{title: 'new_title', tag: [''], permissions: { new_user_name: {'archivist1'=>'edit'}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind setting the title value to an array? I think it causes a deprecation warning, although I know you didn't cause it.

@flyingzumwalt flyingzumwalt force-pushed the generic_file_title_accesible branch 2 times, most recently from 3aeb2a3 to 88dd5a0 Compare November 11, 2014 15:23
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
@flyingzumwalt flyingzumwalt force-pushed the generic_file_title_accesible branch from 88dd5a0 to 7fd39d1 Compare November 11, 2014 15:25
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 7fd39d1 on generic_file_title_accesible into ebf14ab on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 7fd39d1 on generic_file_title_accesible into ebf14ab on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 7fd39d1 on generic_file_title_accesible into ebf14ab on master.

@flyingzumwalt
Copy link
Contributor Author

@jcoyne it looks like this is ready to be merged. Does it need any other attention?

jcoyne added a commit that referenced this pull request Nov 12, 2014
Makes terms_for_display accesible on Worthwhile::GenericFile
@jcoyne jcoyne merged commit 2e525f6 into master Nov 12, 2014
@jcoyne jcoyne deleted the generic_file_title_accesible branch November 12, 2014 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants