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

Add ItemDisplay class to contain logic to create item_display values; related cleanup. #718

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

corylown
Copy link
Contributor

@corylown corylown commented Sep 21, 2022

I think I finally have this in shape for a review. Aside from the tests I added, I also tested this on relatively large batches of SUL MARC records both to ensure the code is guarding against any edge cases and for parity in the field values produced for item_display, shelfkey, and reverse_shelfkey. The only difference is the reverse shelf key now includes the ellipses that get added in ItemDisplay. This change is reflected in the rspec tests and I think is fine or an improvement 🤷 .

closes #714

end

current_location = holding.current_location
current_location = 'ON-ORDER' if holding.is_on_order? && holding.current_location && !holding.current_location.empty? && holding.home_location != 'ON-ORDER' && holding.home_location != 'INPROCESS'
Copy link
Contributor Author

@corylown corylown Sep 22, 2022

Choose a reason for hiding this comment

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

I'm pretty sure this will never get set because holding.is_on_order? only evaluates to true if holding.current_location is already set to ON-ORDER OR if holding.home_location is ON-ORDER in which case the latter holding.home_location != 'ON-ORDER' condition will not pass. 😕 So I've skipped re-implementing this in ItemDisplay.

@corylown corylown force-pushed the item-display branch 2 times, most recently from 9a58c8b to f3e47d1 Compare September 27, 2022 14:51
@corylown corylown marked this pull request as ready for review September 30, 2022 19:18
@cbeer cbeer mentioned this pull request Jun 6, 2023
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.

Refactor item_display field related code for clarity and to reduce duplication of logic
1 participant