This project is archived and is in readonly mode.

#5801 ✓stale

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:

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

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 ( 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=""></a>

People watching this ticket