Skip to content

Instantly share code, notes, and snippets.

View Imranshaikh's full-sized avatar
🏠
Working from home

Imran Shaikh Imranshaikh

🏠
Working from home
View GitHub Profile
@Imranshaikh
Imranshaikh / App model
Created May 14, 2013 04:10
For invalid email in ruby on rails debugging
class User < ActiveRecord::Base
attr_accessible :email, :name, :password, :password_confirmation
has_secure_password
before_save{ self.email.downcase! }
before_save { |user| user.email = email.downcase }
validates(:name, presence: true, length: { maximum: 50 } )