我有这个:
# /app/events/account_cancelled.rb:
module Events
class AccountCancelled < Base::TrackEvent
#/app/events/base/track_event.rb:
module Events
module Base
class TrackEvent < Event
#/app/services/website/base.rb:
module Services
module Website
class Base
我收到错误:
Expected <snip>/app/services/website/base.rb to define Base
from <snip>/app/events/account_cancelled.rb:2
我试图完全限定AccountCancelled
的类定义:
module Events
class AccountCancelled < Events::Base::TrackEvent
但我得到完全相同的错误。顺便说一下,在我将所有这些内容从lib
移到app
之前,一切正常。这是怎么回事?
更新:
我也尝试从::Events::Base::TrackEvent
继承。同样的错误。
答案 0 :(得分:-1)
/app/events/account_cancelled.rb
预计::Base
或Events::Base
,但是
/app/services/website/base.rb:
给出Services::Website::Base
。他们不匹配。