Phusion Passenger错误'Unknown key(s):through'

Rya*_*lah 1 ruby-on-rails passenger

我的rails应用程序在我的本地测试服务器上运行正常,但是当我部署到我的生产(Passenger)服务器时,我收到以下错误:

Error message:
  Unknown key(s): through

Exception class:
  ArgumentError
Run Code Online (Sandbox Code Playgroud)

为什么会发生这种情况?代码本身不存在缺陷,因为在开发服务器上一切正常.令人讨厌的代码非常简单:

class PageEvent < Event
   belongs_to :page, :through => :calendar
end
Run Code Online (Sandbox Code Playgroud)

哪里

class Event < ActiveRecord::Base
  belongs_to :calendar, :polymorphic => true
end
Run Code Online (Sandbox Code Playgroud)

class Calendar < ActiveRecord::Base
  has_many :events, :dependent => :destroy, :inverse_of => :calendar, :as => :calendar, :class_name => "SpecialEvent"
end
Run Code Online (Sandbox Code Playgroud)

num*_*407 5

我不能说它似乎在开发中发生了什么,但没有belongs_to :through.

http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to