Sioux Sioux wrote:
> code for others:
> 
> class User < ActiveRecord::Base
>   before_save :create_username
>   private
> 
>   def create_username
>     self.username = self.email.split('@',2).first
>   end
> 
> end

So what happens when [email protected] and [email protected] both sign up? 
Perhaps you should just use the whole address.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to