Welcome Guest | Login

Undefined method 'belongs_to' in polymorphic image model

Hi i don't get this error in development mode.

Trying to deploy it.

class PageImage < Upload
 belongs_to :page, :class_name => "Page", :foreign_key => :owner_id
end

class Upload < ActiveRecord::Base
 belongs_to :uploadable, :polymorphic => true
end

Get:
undefined method `belongs_to' for PageImage:Class

This is only when try to load pages that call the class.

Any ideas?

2008-02-27 10:20 PM

I can't imagine this would be a FastCGI issue, but I wouldn't be surprised given how many odd errors have shown up with Rails 2.0 and FastCGI via Apache.  I think you may be running this on Mongrel, however - so if that's the case nevermind.


On the production server, can you load up

ruby script/console development
ruby script/console production

and enter

PageImage

Do you get the same error for both?  

2008-02-28 11:59 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!