Flowdock
method

find_one

Importance_0
v3.0.9 - Show latest stable - 0 notes - Class: ActiveRecord::FinderMethods
find_one(id) protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 296
    def find_one(id)
      id = id.id if ActiveRecord::Base === id

      record = where(primary_key.eq(id)).first

      unless record
        conditions = arel.where_sql
        conditions = " [#{conditions}]" if conditions
        raise RecordNotFound, "Couldn't find #{@klass.name} with ID=#{id}#{conditions}"
      end

      record
    end
Register or log in to add new notes.