Flowdock
method

find_one

Importance_0
v1.1.1 - Show latest stable - 0 notes - Class: ActiveRecord::Base
find_one(id, options) private

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/base.rb, line 948
        def find_one(id, options)
          conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
          options.update :conditions => "#{table_name}.#{primary_key} = #{sanitize(id)}#{conditions}"

          if result = find_initial(options)
            result
          else
            raise RecordNotFound, "Couldn't find #{name} with ID=#{id}#{conditions}"
          end
        end
Register or log in to add new notes.