ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/models/stats/scheme_ten_report.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Stats
  class SchemeTenReport
    include ActiveModel::Model
    include ActiveModel::Validations

    attr_accessor :report_date

    validates_each :report_date do |record, attr, value|
      record.errors.add attr, 'must be in the past' if value.to_date >= Time.zone.today
    end
  end
end