Fix bug for last version.
This commit is contained in:
parent
1e18ac077a
commit
9c8c1bd0c4
|
@ -58,7 +58,7 @@ class PHire
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.recurring_event(start_date,end_date,property_id)
|
def self.recurring_event(start_date,end_date,property_id)
|
||||||
@recurring_events = self.where(:property_id => property_id, :recurring => true, :recurring_end_date.gte => start_date)
|
@recurring_events = self.where(:property_id => property_id, :recurring_end_date.gte => start_date)
|
||||||
@recurring = []
|
@recurring = []
|
||||||
@recurring_events.each do |re|
|
@recurring_events.each do |re|
|
||||||
case re.recurring_interval
|
case re.recurring_interval
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Property
|
||||||
available = false
|
available = false
|
||||||
end
|
end
|
||||||
if available
|
if available
|
||||||
bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true)
|
bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true) + phires.where(:recurring => false,:recurring_end_date => nil) + phires.where(:recurring => false,:recurring_end_date.gte => stime)
|
||||||
case interval
|
case interval
|
||||||
when 'week'
|
when 'week'
|
||||||
d_step = 1.week
|
d_step = 1.week
|
||||||
|
|
Loading…
Reference in New Issue