Concatenate unless note mails = []
mails.concat(@note.cc_emails) unless @note.cc_emails.nil?
mails.concat(@note.to_emails) unless @note.to_emails.nil?


Everything what I'm doing here is checking is @note.cc_emails is not nil then concatenating it in mails array.
How can I write it in more efficient way &amp; also reduce the number of lines in the code (if possible)?
These things are very much a matter of preference but I would go for something like:

mails = [ @note.cc_emails,
          @note.to_emails ].compact.join('')


which tends to remain usable as you add more clauses