我有一个模块:未定义的方法,为什么?
module Room::Chair
def get_chair_type(user)
..
end
end
然后,我有一个类方法 'self.get_available_chair',其调用'get_chair_type的方法在Room::Chair
模块的类:
class Store < ActiveRecord::Base
include Room::Chair
def self.get_available_chair(user)
my_chair=get_chair_type(user) # error: undefined method 'get_chair_type'
end
end
我有include Room::Chair
,但我得到了错误未定义的方法'get_chair_type(user)'为什么?