aboutsummaryrefslogblamecommitdiffstats
path: root/activemodel/test/models/automobile.rb
blob: 4df2fe8b3a36afff25fc91dbb32bf1132fbbc90b (plain) (tree)
1
2
3
4
5
6
7
8
9




                                  
                                        


                               
                                               
                                                       
     
   
class Automobile
  include ActiveModel::Validations

  validate :validations

  attr_accessor :make, :model, :approved

  def validations
    validates_presence_of :make
    validates_length_of   :model, within: 2..10
    validates_acceptance_of :approved, allow_nil: false
  end
end