Although this could easily cause an exception (which you are advised to rescue), so you might want to use find_by as an alternative which will return nil rather than raising an exception, depending on how you want to manage things.
Although this could easily cause an exception (which you are advised to rescue), so you might want to use find_by as an alternative which will return nil rather than raising an exception, depending on how you want to manage things.