This project is archived and is in readonly mode.

#6181 ✓resolved
Matthew Ratzloff

ActiveRecord::Base.joins no longer accepts nil

Reported by Matthew Ratzloff | December 16th, 2010 @ 07:02 PM

A break with previous functionality was introduced with Aaron Patterson's recent change to joins, found here:

https://github.com/rails/rails/commit/d98cb5153dad97cde82ec91a1993043cfa9bc0e4

ActiveRecord's joins method no longer accepts either nil or [nil], which breaks some applications that depended on that. Specifically, CanCan's ActiveRecord::Base.accessible_by method now breaks if there are no joins.

https://github.com/ryanb/cancan/blob/master/lib/cancan/active_record_additions.rb

ActiveRecord where(nil), on the other hand, returns a result.

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

Attachments

Referenced by

Pages