From e75f707844069766235891fa523ac1e9a97b44b0 Mon Sep 17 00:00:00 2001 From: Aurelio A. Heckert Date: Fri, 19 Sep 2008 17:59:26 -0300 Subject: [PATCH] ActionItem709: the user e-mail is now editable and visible for friends at the profile page --- app/models/person.rb | 8 ++++++++ app/views/profile/index.rhtml | 14 ++++++++++---- app/views/profile_editor/_person.rhtml | 1 + test/functional/profile_controller_test.rb | 19 +++++++++++++++++++ test/functional/profile_editor_controller_test.rb | 8 ++++++++ test/unit/person_test.rb | 11 +++++++++++ 6 files changed, 57 insertions(+), 4 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 1a9a740..ce28780 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -62,6 +62,14 @@ class Person < Profile self.user.nil? ? nil : self.user.email end + def email= (email) + self.user.email = email if ! self.user.nil? + end + + after_update do |person| + person.user.save! + end + def is_admin? role_assignments.map{|ra|ra.role.permissions}.any? do |ps| ps.any? do |p| diff --git a/app/views/profile/index.rhtml b/app/views/profile/index.rhtml index 83501d6..0c1cbe3 100644 --- a/app/views/profile/index.rhtml +++ b/app/views/profile/index.rhtml @@ -8,16 +8,22 @@