instance method
find_by!
Ruby on Rails 6.0.6
Since v4.0.13Signature
find_by!(arg, *args)
Like #find_by, except that if no record is found, raises an ActiveRecord::RecordNotFound error.
Parameters
-
argreq -
argsrest
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 86
def find_by!(arg, *args)
where(arg, *args).take!
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 86
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods