aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/date_time_test.rb
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-28 14:18:31 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-28 14:18:31 -0500
commit10f6f90d9d1bbc9598bffea90752fc6bd76904cd (patch)
treeef55c28c9ed1238840a2f3af1b166b3ec4ca51e9 /activerecord/test/cases/date_time_test.rb
parente46a8d89baa5b58f19cd84cf9a57beb4507e7d9c (diff)
downloadrails-10f6f90d9d1bbc9598bffea90752fc6bd76904cd.tar.gz
rails-10f6f90d9d1bbc9598bffea90752fc6bd76904cd.tar.bz2
rails-10f6f90d9d1bbc9598bffea90752fc6bd76904cd.zip
AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes.
This fixes the following behaviour: class Person < ActiveRecord::Base belongs_to :company end # Before: person = Person.select('id').first person[:name] # => nil person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => nil person.company # => nil # After: person = Person.select('id').first person[:name] # => ActiveModel::MissingAttributeError: missing_attribute: name person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id person.company # => ActiveModel::MissingAttributeError: missing_attribute: company_id Fixes #5433.
Diffstat (limited to 'activerecord/test/cases/date_time_test.rb')
0 files changed, 0 insertions, 0 deletions