Replace deprecated find_or_create_by.

Rails 4 deprecates the find_or_create_by helpers. This change replaces
the deprecated method while maintaining backwards compatibility with
Rails 3.