Michael Pavling wrote in post #949603: > On 12 October 2010 19:18, Luis Saffie <[email protected]> wrote: >> right, I was checking for nil but that's a string "". Instead do this. >> >> Notifier.appointment_booked(@appointment).deliver unless >> @appointment.client.email.empty? > > Better off using the Rails method .blank? which returns true for nil, > empty strings, empty arrays, all sorts: > > @appointment.client.email.blank? > > http://api.rubyonrails.org/classes/Object.html#method-i-blank
True! Worked too :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

