Sha256: d722665630632e24d730cd5f3d65dc7fc87b7549abba58e4ee8d613e8d2ab7f1

Contents?: true

Size: 722 Bytes

Versions: 16

Compression:

Stored size: 722 Bytes

Contents

class User < ActiveRecord::Base
  validates :name,
    :length => { :minimum => 2, :maximum => 24, :message => "has invalid length"},
    :presence => {:message => "can't be blank"}
  validates :last_name,
    :length => { :minimum => 2, :maximum => 24, :message => "has invalid length"},
    :presence => {:message => "can't be blank"}
  validates :address,
    :length => { :minimum => 5, :message => "too short length"},
    :presence => {:message => "can't be blank"}
  validates :email,
    :presence => {:message => "can't be blank"},
    :format => {:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :message => "has wrong email format"}
  validates :zip, :numericality => true, :length => { :minimum => 5 }
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
best_in_place-0.2.3 test_app/app/models/user.rb
best_in_place-0.2.2 test_app/app/models/user.rb
best_in_place-1.0.2 test_app/app/models/user.rb
best_in_place-0.2.1 test_app/app/models/user.rb
best_in_place-1.0.1 test_app/app/models/user.rb
best_in_place-0.2.0 test_app/app/models/user.rb
best_in_place-1.0.0 test_app/app/models/user.rb
best_in_place-0.1.9 test_app/app/models/user.rb
best_in_place-0.1.8 test_app/app/models/user.rb
best_in_place-0.1.7 test_app/app/models/user.rb
best_in_place-0.1.6 test_app/app/models/user.rb
best_in_place-0.1.5 test_app/app/models/user.rb
best_in_place-0.1.4 test_app/app/models/user.rb
best_in_place-0.1.3 test_app/app/models/user.rb
best_in_place-0.1.2 test_app/app/models/user.rb
best_in_place-0.1.1 test_app/app/models/user.rb