This project is archived and is in readonly mode.

#5801 ✓stale
yipdw

ActiveRecord::Base#exists? raises exception when using :include in default_scope

Reported by yipdw | October 13th, 2010 @ 06:10 PM

When using default_scope containing :include, ActiveRecord::Base#exists? raises a ActiveRecord::MissingAttributeError.

A demonstration of the error for ActiveRecord 2.3.9 is available here:

http://gist.github.com/624421/4735425e696993b7d409c7cb8b77878461712881

A demonstration of the error for ActiveRecord 3.0.0 is available here:

https://gist.github.com/624421/417c372a474a16566989261c8e0f9944fe32...

Neither of these are proper automated test cases, but it should be possible to fit them into ActiveRecord's test suite without too much difficulty.

This error appears to be related to the change introduced by #2543. Robin Salkeld's comment on #2543 (https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...) seems especially relevant.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages