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 »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Pages