mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
110145900-date_conflict_fixed
This commit is contained in:
parent
a59d61aa44
commit
5e05aee1c8
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ class Pricelist < ActiveRecord::Base
|
||||||
def pricelist_for(zone, operation, period)
|
def pricelist_for(zone, operation, period)
|
||||||
lists = valid.where(category: zone, operation_category: operation, duration: period)
|
lists = valid.where(category: zone, operation_category: operation, duration: period)
|
||||||
return lists.first if lists.count == 1
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue