error when method Depends on result of background method

Viewed 29

I have method get_all_emails return all emails by some condition . when call this method inside other method and pass result as arg to method

def send_mail 
    emails = Mail.get_emails_list(Mail::EMAIL)
    validate_emails = get_validate(emails , true)
    if validate_emails != ''
      puts "hello"
    end

end

appear this error

"error": "wrong number of arguments (given 1, expected 0)"

when read some article can convert get_validate to background less priority but if not know this is optimal solution or not . if exist solution without this solution convert get_validate to background

I use rails 5.2 & gem delayed_job_active_record

more info for error

rails server 

AlertMai#send_mail: processed outbound mail in 243.7ms

Postman appear this 
500Internal Server Error
{
    "error": "wrong number of arguments (given 1, expected 0)"
}
0 Answers
Related