Rate is not a class

Here’s one I haven’t seen before I have a model “section.rb” as follows:

class Section < ActiveRecord::Base
###Lot of common stuff
end

class Normal < Section
end

class Faq < Section
has_many :faq_categories, :order => :position
end

class Rate < Section
has_many :rate_tables
end

Now I’ve just added the Rates class and it works just dandy (new, save,
destroy, etc.) in the console. The problem is using in my app. I can
start webrick, and make 2-3 requests before getting the following error:
(If you want the full long trace, just let me know)

TypeError in #

Rate is not a class

RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/models/section.rb:82
#{RAILS_ROOT}/app/controllers/application.rb:8

This error occured while loading the following files:
application.rb
=> model section.rb
section.rb

(Yes I have restarted my machine. Yes this cycle will repeat on each
webrick restart. So shutting down webrick and restarting gets me 2-3
good requests before the crap-out.)

I am using the Faq class successfully in my app. Is “Rate” some kind of
reserved word I didn’t know of? Any help would be great.

(I’m running XP, Ruby 1.8.2, Rails 1.1. And I would move up to 1.8.4 but
it breaks with RMagick everytime I try…but that’s another post for
another day.)

On Friday, June 23, 2006, at 4:26 AM, Mark McSpadden wrote:

has_many :faq_categories, :order => :position

This error occured while loading the following files:

(I’m running XP, Ruby 1.8.2, Rails 1.1. And I would move up to 1.8.4 but
it breaks with RMagick everytime I try…but that’s another post for
another day.)

Posted with http://DevLists.com. Sign up and save your mailbox.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

So apparently I had an extra “rate” folder floating around in my
components folder. Removing it did the trick.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs