rails/rails — Issue #4208: ActiveRecord::QueryMethods#select bug (3.2.0.rc1)
Author: rafaeldx7
Created: 2011-12-27 21:06:23+00:00
State: open

Rails 3.1

```ruby
Loading development environment (Rails 3.1.3)
ruby-1.9.3 irb> user = User.select(:email).first
=> #
ruby-1.9.3 irb> user.respond_to? :created_at
=> true
ruby-1.9.3 irb> user.created_at
=> nil
```

Rails 3.2

```ruby
Loading development environment (Rails 3.2.0.rc1)
ruby-1.9.3 irb> user = User.select(:email).first
=> #
ruby-1.9.3 irb> user.respond_to? :created_at
=> true
ruby-1.9.3 irb> user.created_at
ActiveModel::MissingAttributeError: missing attribute: created_at
from (irb):3
from /Users/rafaeldx7/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/commands/console.rb:47:in `start'
from /Users/rafaeldx7/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/commands/console.rb:8:in `start'
from /Users/rafaeldx7/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/commands.rb:41:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```

Doc: http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-select