From 5e05aee1c8d0f1091b6ddcd8d76712080a7229f2 Mon Sep 17 00:00:00 2001 From: Stas Date: Fri, 18 Dec 2015 16:53:55 +0200 Subject: [PATCH] 110145900-date_conflict_fixed --- app/models/pricelist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/pricelist.rb b/app/models/pricelist.rb index 42cca0126..17420dfa1 100644 --- a/app/models/pricelist.rb +++ b/app/models/pricelist.rb @@ -31,7 +31,7 @@ class Pricelist < ActiveRecord::Base def pricelist_for(zone, operation, period) lists = valid.where(category: zone, operation_category: operation, duration: period) return lists.first if lists.count == 1 - lists.where('valid_to IS NOT NULL').order(valid_from: :desc).first + lists.order(valid_from: :desc).first end end end