Skip to content

Commit

Permalink
Merge pull request #439 from roomorama/release/0.12.5
Browse files Browse the repository at this point in the history
Release/0.12.5
  • Loading branch information
keang authored Oct 11, 2016
2 parents b8708af + a7cfb5d commit 45c7064
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This file summarises the most important changes that went live on each release
of Concierge. Please check the Wiki entry on the release process to understand
how this file is formatted and how the process works.

## [0.12.5] - 2016-10-11
### Fixed
- Fix crash when kigo pricing does not return MIN_STAY rules #430

## [0.12.4] - 2016-10-11
### Fixed
- uninitialized constant `API::Controllers::InternalError` for ubuntu 16.04
Expand Down
1 change: 1 addition & 0 deletions lib/concierge/suppliers/kigo/mappers/pricing_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def currency
end

def minimum_stay
return 0 unless min_stay_valid?
rules = periodical_rate.get('MIN_STAY.MIN_STAY_RULES')
rules.collect do |rule|
before_to = rule['DATE_TO'].nil? || DateTime.parse(rule['DATE_TO']) < DateTime.now
Expand Down
1 change: 0 additions & 1 deletion lib/concierge/suppliers/kigo/mappers/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def prepare(property_data, pricing_data)

pricing_mapper = PricingSetup.new(payload['PROP_RATE'], pricing)
return Result.error(:no_prices_provided) unless pricing_mapper.valid?
return Result.error(:invalid_min_stay, pricing) unless pricing_mapper.min_stay_valid?

set_price(pricing_mapper)
set_images
Expand Down
2 changes: 1 addition & 1 deletion lib/concierge/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Concierge
VERSION = "0.12.4"
VERSION = "0.12.5"
end
5 changes: 2 additions & 3 deletions spec/lib/concierge/suppliers/kigo/mappers/property_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@
context 'pricing_setup does not have MIN_STAY' do
it 'returns an error Result' do
pricing['MIN_STAY'] = nil
result = subject.prepare(property_data, pricing)
expect(result).to_not be_success
expect(result.error.code).to eq(:invalid_min_stay)
property = subject.prepare(property_data, pricing).value
expect(property.minimum_stay).to eq 7 # according to property data
end
end

Expand Down

0 comments on commit 45c7064

Please sign in to comment.