Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Using scope causes models not to respect non-pluralization

#6686

My first ticket so forgive errors please.

In config/environment.rb we have

ActiveRecord::Base.pluralize_table_names = false

Which works flawlessly until we add a named scope to a model such as:

class Disease < ActiveRecord::Base
  scope :active, where(:active=>true)
...

Without the scope, the model/DB interaction works perfectly. However, adding the scope line causes ActiveRecord to pluralize the table name.

Overriding with

set_table_name 'disease'

gets it working again but shouldn't be necessary.

Thanks
Michael.

Reported by Michael McGrath · April 8th, 2011 @ 02:30 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

No comments yet.