Skip to content

Instantly share code, notes, and snippets.

@xhoy
Last active August 29, 2015 14:13
Show Gist options
  • Save xhoy/9a31d26854890cbd8326 to your computer and use it in GitHub Desktop.
Save xhoy/9a31d26854890cbd8326 to your computer and use it in GitHub Desktop.
emails_user_type = if emails.user_type.present?
email.user_type.to_a
else
[Email.new(emailaddress: "dummy@dummy.com")]
end
@kurtfunai
Copy link

emails_user_type = emails.user_type.present? ? email.user_type.to_a : [Email.new(emailaddress: "dummy@dummy.com")]

@xhoy
Copy link
Author

xhoy commented Jan 8, 2015

suggestions from irc:

emails_system_type = Array (
  emails.system_type.presence || 
  Email.new(emailaddress: "dummy@dummy.coml")
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment