我的代碼找不到模塊並返回一個零錯誤。Rails:找不到錯誤類
undefined method `next' for nil:NilClass
這裏是代碼
module Test
class MyTestClass
before_save :cid
def cid
MyTestClass.maximum(:id).next #error here, can't find MyTestClass
end
end
我試着像變種測試:: MyTestClass但沒有奏效。