Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.37 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2.   validates  :username, :presence => true, :uniqueness => true, :length => { :minimum => 3, :maximum => 16}
  3.   validates  :password, :presence => true,
  4.                         :length   => { :minimum => 6 }
  5.  
  6.   validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create
  7.  
  8.   belongs_to :subscribers
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement