Advertisement
atomAltera

Plain User model

Mar 26th, 2014
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.39 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2.     has_many :cash_flows, :dependent => :destroy
  3.     has_many :tags, :dependent => :destroy
  4.  
  5.     has_secure_password(validations: false)
  6.  
  7.     validates_presence_of :nick, :password
  8.     validates_confirmation_of :password
  9.  
  10.     validates_uniqueness_of :nick, case_sensitive: false
  11.     validates_length_of :nick, minimum: 2, maximum: 64
  12.     validates_length_of :password, minimum: 6
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement