I'm using Ruby on Rails and i have a find_or_create_by_custom_stuff method. However i would like to know if the object i get back was found, or was created. Something like this
user = User.find_or_create_by_custom_stuff(params[:user])
if user.was_found_from_database?
...
elsif user.was_recently_created?
...
end
Is there any way I can do this without relying on the created_at timestamp of the user?