Ruby on Rails Thursday, September 1, 2011

Philip Hallstrom wrote in post #1019611:
>
> could be false for any number of reasons -- perhaps you have a
> validation that rejects "example.com" as a valid email address.
>

Does he? Here's his model:

class User < ActiveRecord::Base
has_many :accounts, :dependent => :destroy

validates :email, :presence => true
validates :name, :presence => true
validates :password, :presence => true, :length =>
{ :minimum => 8, :maximum => 2000, :message => 'should be between 8
and 2000 characters' }
validates :security_question, :presence => true
validates :security_answer, :presence => true
validates :mobile_phone, :length =>
{ :minimum => 8, :maximum => 30, :message => 'should be between 8 and
30 characters'}

end

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment