From 86cf5f9a13f5edc80eb5960eea27c52d8ceba12d Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 20 May 2020 16:55:19 +0800 Subject: [PATCH] fix error --- app/controllers/admin/property_hires_controller.rb | 4 ++-- app/controllers/property_hires_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 42e013b..83b42bc 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -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 diff --git a/app/controllers/property_hires_controller.rb b/app/controllers/property_hires_controller.rb index 53ac132..68acab8 100644 --- a/app/controllers/property_hires_controller.rb +++ b/app/controllers/property_hires_controller.rb @@ -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