rewrite removing find_or_create_by method that is not longer available in rails 4.1 while retaining backwards compatibility with rails 3.2