aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/models/automobile.rb
blob: 021ea61c803e7bc85606fdb7221d161e9ec2d94a (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