2
我認爲麻煩來自於這是一個自定義模型。爲自定義attr_accessor獲取未定義的方法`validates_presence_of'
錯誤:
undefined method `validates_presence_of' for Calculation:Class
我的模型:
class Calculation
extend ActiveModel::Naming
include ActiveModel::Conversion
def persisted?
false
end
attr_accessor :name, :docket_num, :payments, :our_file_num,
:date_awarded, :date_paid, :amount_paid, :judgement_balance,
:results, :total_interest, :per_diem, :lda
validates_presence_of :date_awarded, :docket_num, :judgement_balance
可能有一些東西我需要包括或擴展讓Rails的驗證?該項目在一個鐵軌項目中,但我手工構建了該模型。
任何想法?