문제

My source is at: https://gist.github.com/f01685376a02a577a9cb

the method in question:

def is_valid_email?(address)
  User.find_by_email(address)
end

I think the solution is to change the value for User.find_by_email(address) to something like User.find_by_email(next_approver_email) = (address) but I know that doesn't work.

Next_approver_email is what we are tying to check against the user.email db column

any ideas?

도움이 되었습니까?

해결책

You need to pass the email into is_valid_email? at the end of line 5

def validate_each(approval, attribute, value)
   approval.errors[attribute] << "must be a valid e-mail address in our system" unless is_valid_email?(value)
end
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top