Phusion Passenger error 'Unknown key(s): through'
My rails applic开发者_运维技巧ation runs fine on my local testing server, but when I deploy to my production (Passenger) server, I get the following error:
Error message:
Unknown key(s): through
Exception class:
ArgumentError
Why might this be happening? The code can't be inherently flawed, since everything works fine on the development server. The offending piece of code is very simple:
class PageEvent < Event
belongs_to :page, :through => :calendar
end
where
class Event < ActiveRecord::Base
belongs_to :calendar, :polymorphic => true
end
and
class Calendar < ActiveRecord::Base
has_many :events, :dependent => :destroy, :inverse_of => :calendar, :as => :calendar, :class_name => "SpecialEvent"
end
I can't say what is happening that it appears to be working in dev, but there is no belongs_to :through
.
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to
精彩评论