1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add example to ActiveModel::MissingAttributeError [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-07-28 01:19:38 -05:00
parent ac18d642e9
commit b8672914b7

View file

@ -3,6 +3,14 @@ require 'active_support/deprecation'
module ActiveModel
# Raised when an attribute is not defined.
#
# class User < ActiveRecord::Base
# has_many :pets
# end
#
# user = User.first
# user.pets.select(:id).first.user_id
# # => ActiveModel::MissingAttributeError: missing attribute: user_id
class MissingAttributeError < NoMethodError
end
# == Active Model Attribute Methods