public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
shoulda / test / rails_root / app / models / address.rb
100644 8 lines (6 sloc) 0.248 kb
1
2
3
4
5
6
7
8
class Address < ActiveRecord::Base
  belongs_to :addressable, :polymorphic => true
  validates_uniqueness_of :title, :scope => [:addressable_type, :addressable_id]
  
  validates_length_of :zip, :minimum => 5
  validates_numericality_of :zip
end