This project is archived and is in readonly mode.

#4167 ✓resolved
FlyboyArt

ActiveRecord - named_scope using ':columns' as the name is buggered

Reported by FlyboyArt | March 13th, 2010 @ 02:56 PM

I spent all afternoon on this one but it's rewarding to find it....

Given a model called "Article"

I have a list of named_scope directives as follows:

  named_scope :active,  :conditions => {:active     => true}
  named_scope :journal, :conditions => {:department => 0}
  named_scope :features,:conditions => {:department => 1}
  # NOTE: If you use :columns here, it's buggered!
  named_scope :column,  :conditions => {:department => 2}
  named_scope :news,    :conditions => {:department => 3}
  named_scope :tips,    :conditions => {:department => 4}

If I use :column for a name, it works fine. If I use :columns for a name the model's attributes are not accessible in script/console or when rails is running normally.

-Art

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