aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/models/automobile.rb
blob: ece644c40c98fa905eb19af08d35e12d76dc2f36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
class Automobile
  include ActiveModel::Validations

  validate :validations

  attr_accessor :make, :model

  def validations
    validates_presence_of :make
    validates_length_of   :model, within: 2..10
  end
end