mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Merge pull request #51 from internetee/110145900-pricelists-bug
110145900-date_conflict_fixed
This commit is contained in:
commit
010d6e45b3
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