Fix valid_to #2741

This commit is contained in:
Martin Lensment 2015-07-28 13:08:02 +03:00
parent 1a10b1400b
commit 0ea07de2d1
5 changed files with 23 additions and 2 deletions

View file

@ -1,7 +1,7 @@
class Pricelist < ActiveRecord::Base
include Versions # version/pricelist_version.rb
scope :valid, -> { where("valid_from <= ? AND valid_to >= ? OR valid_to IS NULL", Time.zone.now, Time.zone.now) }
scope :valid, -> { where("valid_from <= ? AND valid_to >= ? OR valid_to IS NULL", Time.zone.now.end_of_day, Time.zone.now.beginning_of_day) }
monetize :price_cents