Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make :name argument optional in Folio::Library #1879

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

corylown
Copy link
Contributor

Fixes #1877

When we instantiate Folio::Library with data from the FOLIO API (FolioClient.new.find_instance_by(hrid: 'a3978751')) the library information on the item contains only an :id and a :code so :name needs to be optional.

@cbeer cbeer merged commit ccb0c8d into main Sep 28, 2023
@cbeer cbeer deleted the corylown-patch-4 branch September 28, 2023 14:58
@jcoyne
Copy link
Contributor

jcoyne commented Sep 28, 2023

@corylown what does that mean? How is it at a nameless library?

@corylown
Copy link
Contributor Author

@jcoyne the library data we get back from FOLIO that's included in an instance record's item metadata contains only an id and a code: "library"=> {"id"=>"f6b5519e-88d9-413e-924d-9ed96255f72e", "code"=>"GREEN"}. I think that's all that's needed in this case to validate the request type.

You can trace the calls from here: https://github.com/sul-dlss/sul-requests/blob/main/app/models/folio/instance.rb#L12 where the app passes instance record data down to Folio::Item, Folio::Location, then Folio::Library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sul-requests/stage] ArgumentError: missing keyword: :name
3 participants