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

GenericFile Title does not update when you set it in Create or Update forms #34

Open
flyingzumwalt opened this issue Nov 11, 2014 · 3 comments
Labels

Comments

@flyingzumwalt
Copy link
Contributor

This is because CurationConcern::GenericFileActor uses sanitize_attributes, which relies on accessible_attributes, which is set via attr_accessible.

From https://github.com/curationexperts/worthwhile/blob/master/worthwhile-models/app/actors/curation_concern/generic_file_actor.rb#L19. BTW - the comment on this method mentions a release of Sufia 7.1???

generic_file.attributes = generic_file.sanitize_attributes(attributes)

attr_accessible behavior is deprecated in Rails. Looks like it's been re-implemented (partially) in Sufia? Not quite sure what's up with that. (see https://github.com/projecthydra/sufia/blob/master/sufia-models/app/models/concerns/sufia/generic_file/accessible_attributes.rb)

@jcoyne There are enough layers of strangeness here that I think this ticket needs attention.

flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
@flyingzumwalt
Copy link
Contributor Author

Added a branch that tests and fixes this, but I'm not confident that this is how you want to fix it (example: Could set attr_accessible inside of Worthwhile::GenericFileBase instead of in Worthwhile::GenericFile, or could refuse to use attr_accessible???), so not submitting a PR yet.

@jcoyne
Copy link
Contributor

jcoyne commented Nov 11, 2014

@flyingzumwalt My thoughts are to get rid of attr_accessible.

@jcoyne
Copy link
Contributor

jcoyne commented Nov 11, 2014

@flyingzumwalt If you don't want to go that far, look at what Sufia does here https://github.com/projecthydra/sufia/blob/1c8879de85f5b11c3f48e88f10e1d8d96123d010/sufia-models/app/models/concerns/sufia/generic_file.rb#L30

copy that to Worthwhile::GenericFileBase

flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
flyingzumwalt added a commit that referenced this issue Nov 11, 2014
…ield on GenericFile create/update form actually gets applied to the GenericFile object

refs #34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants