I think the trouble is coming from the fact this is a custom Model.
Error:
undefined method `validates_presence_of' for Calculation:Class
My Model:
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
Possibly there is something I need to include or extend to get Rails validations? The project is within a rails project, but I constructed the model by 开发者_StackOverflowhand.
Any ideas?
try including ActiveModel::Validations
.
For more info checkout the documentation on it
精彩评论