From fbdc8a69d843f77a8d8412c2dd3d9f065c9fcd65 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 7 Sep 2007 16:03:48 +0000 Subject: [PATCH] ActionItem8: documenting info interface to profiles --- app/models/profile.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index 37be19f..3803e99 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -4,7 +4,7 @@ class Profile < ActiveRecord::Base after_create do |profile| - homepage = Comatose::Page.new + homepage = Article.new homepage.title = profile.name homepage.parent = Comatose::Page.root homepage.slug = profile.identifier @@ -12,7 +12,7 @@ class Profile < ActiveRecord::Base end after_destroy do |profile| - Comatose::Page.find_by_path(profile.identifier).destroy + Article.find_by_path(profile.identifier).destroy end # Valid identifiers must match this format. @@ -65,4 +65,21 @@ class Profile < ActiveRecord::Base find_tagged_with(term) + find_all_by_name(term) end + # Returns information about the profile's owner that was made public by + # him/her. The returned value must be an array in the followinf format: + # + # [ + # [ 'First Field', first_field_value ], + # [ 'Second Field', second_field_value ], + # ] + # + # This information shall be used by user interface to present the information + # + # In this class, this method returns nil, what is interpreted as "no + # information at all". Subclasses must override this method to provide their + # specific information. + def info + nil + end + end -- libgit2 0.21.2