diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-04-30 10:15:54 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-30 10:15:54 +0100 |
commit | c11fd63b39fdb4030a3714a0fb4fd11db31eac7d (patch) | |
tree | 5b0f409ebb4581a64532b0b10217e9a451d4e344 /app/models | |
parent | a48e18ac9ee891e04d6082d8efb126017e69ea87 (diff) | |
parent | cad1d485718b3c08a31f6063c0a799ed8c1e8225 (diff) |
Merge branch 'rails-3-develop' of ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/holiday_import.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index c6019fac0..98a9b96fc 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -84,10 +84,14 @@ class HolidayImport end def populate_from_suggestions - holiday_info = Holidays.between(start_date, end_date, @country_code.to_sym, :observed) - holiday_info.each do |holiday_info_hash| - holidays << Holiday.new(:description => holiday_info_hash[:name], - :day => holiday_info_hash[:date]) + begin + holiday_info = Holidays.between(start_date, end_date, @country_code.to_sym, :observed) + holiday_info.each do |holiday_info_hash| + holidays << Holiday.new(:description => holiday_info_hash[:name], + :day => holiday_info_hash[:date]) + end + rescue Holidays::UnknownRegionError + [] end end end |