fix error
This commit is contained in:
parent
73241e7b18
commit
86cf5f9a13
|
@ -43,7 +43,7 @@ class Admin::PropertyHiresController < OrbitAdminController
|
||||||
property = Property.find(params[:id]) rescue nil
|
property = Property.find(params[:id]) rescue nil
|
||||||
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
|
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 = 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?
|
property.destroy if !property.nil?
|
||||||
if params[:page]
|
if params[:page]
|
||||||
redirect_to admin_property_hires_path(:page => params[:page])
|
redirect_to admin_property_hires_path(:page => params[:page])
|
||||||
|
@ -58,7 +58,7 @@ class Admin::PropertyHiresController < OrbitAdminController
|
||||||
property.update_attributes(property_params)
|
property.update_attributes(property_params)
|
||||||
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
|
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 = 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]
|
if params[:page]
|
||||||
redirect_to admin_property_hires_path(:page => params[:page])
|
redirect_to admin_property_hires_path(:page => params[:page])
|
||||||
else
|
else
|
||||||
|
|
|
@ -169,7 +169,7 @@ class PropertyHiresController < ApplicationController
|
||||||
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
|
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 = 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
|
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
|
end
|
||||||
redirect_to params[:url]
|
redirect_to params[:url]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue