diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 17e99f0..a33e0cc 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -64,6 +64,13 @@ class Admin::PropertyHiresController < OrbitAdminController @booking = PHire.find(params[:id]) rescue nil end + def delete_booking_details + booking = PHire.find(params[:id]) + property = booking.property + booking.destroy + redirect_to admin_property_hire_path(property) + end + def pass_booking phire = PHire.find(params[:id]) rescue nil case params[:status] diff --git a/app/models/p_hire.rb b/app/models/p_hire.rb index a8840d8..9f6cdd0 100644 --- a/app/models/p_hire.rb +++ b/app/models/p_hire.rb @@ -39,7 +39,7 @@ class PHire end def self.monthly_event(start_date,end_date,property_id) - self.where(:property_id => property_id, :passed => true).any_of(:start_time.gte => start_date, :end_time.gte => start_date).and(:start_time.lte => end_date).asc(:start_time) + self.where(:property_id => property_id).any_of(:start_time.gte => start_date, :end_time.gte => start_date).and(:start_time.lte => end_date).asc(:start_time) end end \ No newline at end of file diff --git a/app/views/admin/property_hires/show.html.erb b/app/views/admin/property_hires/show.html.erb index 8ed0f35..e7f579f 100644 --- a/app/views/admin/property_hires/show.html.erb +++ b/app/views/admin/property_hires/show.html.erb @@ -1,3 +1,4 @@ +<%= csrf_meta_tag %>