Created
December 1, 2017 02:15
-
-
Save cirode/1b679bb5e5b03f9ca301149f4b36e506 to your computer and use it in GitHub Desktop.
Hooroo: Cleansing Operation For Maximum Stays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Offer.includes(room_type: :property).where('properties.status=? and offers.default_maximum_stay=?', 'published',1).find_each do |offer| | |
offer.default_maximum_stay = nil | |
offer.rates.where('night_of >= ? and maximum_stay=?', Date.today,1).find_each do |rate| | |
rate.maximum_stay = nil | |
rate.save! | |
end | |
offer.save! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment