From 9fe201bc1fcb626bbb579a700bd5b3bfebf99ab3 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Fri, 1 Nov 2019 10:43:32 -0600 Subject: [PATCH 1/2] missing variable declaration in Location error handling --- CHANGELOG.md | 3 +++ app/helpers/holdings_helper.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f2c54d8f..6d6d5ae88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver ## [Unreleased] +### Fixed +- missing variable declaration in Location error handling [#1824](https://github.com/ualbertalib/discovery/issues/1824) + ### Changed - updated occurences of University of Alberta Libraries to Library (new name) [#1813](https://github.com/ualbertalib/discovery/issues/1813) diff --git a/app/helpers/holdings_helper.rb b/app/helpers/holdings_helper.rb index 216d94507..a1aabb102 100644 --- a/app/helpers/holdings_helper.rb +++ b/app/helpers/holdings_helper.rb @@ -70,7 +70,7 @@ def request_microform?(item) # returns the library description that matches the code coming from symphony ws def library_location(library_code) Location.find_by!(short_code: library_code.downcase.delete('_').to_sym).name - rescue ActiveRecord::RecordNotFound + rescue ActiveRecord::RecordNotFound => e Rollbar.error("Error retriving name for Location #{library_code.downcase.delete('_').to_sym}", e) 'Unknown' end From 7f530929e86beeaa8486b5112c291a7cb0d4faf8 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Fri, 1 Nov 2019 10:49:47 -0600 Subject: [PATCH 2/2] fix typo in Holdings Helper --- CHANGELOG.md | 1 + app/helpers/holdings_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6d5ae88..4658880ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver ### Fixed - missing variable declaration in Location error handling [#1824](https://github.com/ualbertalib/discovery/issues/1824) +- typo of CirculationRule in Holdings Helper [#1823](https://github.com/ualbertalib/discovery/issues/1823) ### Changed - updated occurences of University of Alberta Libraries to Library (new name) [#1813](https://github.com/ualbertalib/discovery/issues/1813) diff --git a/app/helpers/holdings_helper.rb b/app/helpers/holdings_helper.rb index a1aabb102..62eb50fc0 100644 --- a/app/helpers/holdings_helper.rb +++ b/app/helpers/holdings_helper.rb @@ -31,9 +31,9 @@ def item_type(item) end def reserve_rule(item) - CirculationRules.find_by!(short_code: item[:reserve_rule].to_sym).name + CirculationRule.find_by!(short_code: item[:reserve_rule].to_sym).name rescue ActiveRecord::RecordNotFound => e - Rollbar.error("Error retriving name for CirculationRules #{item[:reserve_rule].to_sym}", e) + Rollbar.error("Error retriving name for CirculationRule #{item[:reserve_rule].to_sym}", e) 'Unknown' end