2

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 hand.

Any ideas?

JW8
  • 1,496
  • 5
  • 21
  • 36
Trip
  • 26,756
  • 46
  • 158
  • 277

1 Answers1

5

try including ActiveModel::Validations.

For more info checkout the documentation on it

BaroqueBobcat
  • 10,090
  • 1
  • 31
  • 37