diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 83fb226..901c9b5 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -80,7 +80,7 @@ class Admin::PropertyHiresController < OrbitAdminController def destroy property = Property.find(params[:id]) rescue nil - email = MemberProfile.where(:id.in=>property.owners).collect{|v| v.email} + email = MemberProfile.where(:id.in=>property.owners.to_a).collect{|v| v.email} Admin::PropertyHiresHelper::HireMethod.send_mail('delete',email,property.id,nil,nil,current_user.id) property.destroy if !property.nil? if params[:page] @@ -115,7 +115,7 @@ class Admin::PropertyHiresController < OrbitAdminController property.p_hire_fields.each{|t| t.destroy if t["to_delete"] == true} else property.update_attributes(@property_params) - email = MemberProfile.where(:id.in=>property.owners).collect{|v| v.email} + email = MemberProfile.where(:id.in=>property.owners.to_a).collect{|v| v.email} Admin::PropertyHiresHelper::HireMethod.send_mail('edit',email,property.id,nil,nil,current_user.id) end redirect_to params[:referer_url] @@ -287,7 +287,7 @@ class Admin::PropertyHiresController < OrbitAdminController prop[:weekdays] = [] end if prop[:owners].nil? - prop[:owners] = nil + prop[:owners] = [] end prop.delete(:property_location) if prop[:property_location] == "other" notes_selector = prop["notes_selector"] diff --git a/app/controllers/property_hires_controller.rb b/app/controllers/property_hires_controller.rb index 6af06c5..7c31282 100644 --- a/app/controllers/property_hires_controller.rb +++ b/app/controllers/property_hires_controller.rb @@ -378,8 +378,8 @@ class PropertyHiresController < ApplicationController if property.can_hire_before_months != 0 get_end_time = [time_now + (property.can_hire_before_months).send("month"),edt].min end - allevents += generate_all_reserve_buttons(get_start_time,get_end_time,all_day_settings,check_setting) end + allevents += generate_all_reserve_buttons(get_start_time,get_end_time,all_day_settings,check_setting) end end end diff --git a/app/models/property.rb b/app/models/property.rb index 4ff42f4..c397c11 100644 --- a/app/models/property.rb +++ b/app/models/property.rb @@ -593,6 +593,7 @@ class Property property end def fix_uploader(clone_relation, r, f) + return r.send(f).blank? if !@clone_mode || (clone_relation[f].blank? && clone_relation.send(f).blank?) clone_relation[f] = r[f] if @clone_mode