0
아파트의 단위 번호가 10자를 넘고 아파트 상태가 사용 가능할 경우 메일러가 실행됩니다. 메일러는 정상적으로 작동하지만 필요한 목록 대신 모든 목록을 반환합니다. 어떤 도움을 주셔서 감사합니다.레이크 작업이 메일러를 벗어나 올바른 결과를 반환하지 않습니다.
too_long.rake 것은
namespace :listings do
desc 'Notifies an agent when the unit is too long'
task notify_agent_unit: :environment do
Listing.all.each do |listing|
if Listing.where("length(apartment) > 10") && Listing.where(status: 'Available')
TooLongMailer.unit_too_long(listing, listing.listing_agent).deliver_now
end
end
end
end