Commit 1a041f1cdadc1ba55fd43807002384acd513183b

Authored by AntonioTerceiro
1 parent 730ab70d

ActionItem9: every new user gets its own profile



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@101 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/models/user.rb
1 require 'digest/sha1' 1 require 'digest/sha1'
2 class User < ActiveRecord::Base 2 class User < ActiveRecord::Base
3 3
4 - before_create do |user|  
5 - # TODO 4 + after_create do |user|
  5 + Profile.create!(:identifier => user.login, :user_id => user.id)
6 end 6 end
7 has_one :personal_profile, :class_name => Profile 7 has_one :personal_profile, :class_name => Profile
8 8