fix error

This commit is contained in:
chiu 2020-05-20 16:55:19 +08:00
parent 73241e7b18
commit 86cf5f9a13
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class Admin::PropertyHiresController < OrbitAdminController
property = Property.find(params[:id]) rescue nil
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
HireMethod.send_mail('delete',email,property.id)
Admin::PropertyHiresHelper::HireMethod.send_mail('delete',email,property.id)
property.destroy if !property.nil?
if params[:page]
redirect_to admin_property_hires_path(:page => params[:page])
@ -58,7 +58,7 @@ class Admin::PropertyHiresController < OrbitAdminController
property.update_attributes(property_params)
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
HireMethod.send_mail('edit',email,property.id)
Admin::PropertyHiresHelper::HireMethod.send_mail('edit',email,property.id)
if params[:page]
redirect_to admin_property_hires_path(:page => params[:page])
else

View File

@ -169,7 +169,7 @@ class PropertyHiresController < ApplicationController
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
email << hire.hiring_person_email
HireMethod.send_mail('p_hire',email,property.id,nil,hire.id)
Admin::PropertyHiresHelper::HireMethod.send_mail('p_hire',email,property.id,nil,hire.id)
end
redirect_to params[:url]
else