Fix find_or_create_by deprecations in Rails 4

Also maintain compatibility w/ older rails.