instance method
take!
Ruby on Rails 4.2.9
Since v4.0.13Signature
take!()
Same as take but raises ActiveRecord::RecordNotFound if no record is found. Note that take! accepts no arguments.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 110
def take!
take or raise RecordNotFound.new("Couldn't find #{@klass.name} with [#{arel.where_sql}]")
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 110
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods