Commit fbdc8a69d843f77a8d8412c2dd3d9f065c9fcd65
1 parent
72e75dbd
Exists in
master
and in
22 other branches
ActionItem8: documenting info interface to profiles
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@416 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
19 additions
and
2 deletions
Show diff stats
app/models/profile.rb
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | class Profile < ActiveRecord::Base |
| 5 | 5 | |
| 6 | 6 | after_create do |profile| |
| 7 | - homepage = Comatose::Page.new | |
| 7 | + homepage = Article.new | |
| 8 | 8 | homepage.title = profile.name |
| 9 | 9 | homepage.parent = Comatose::Page.root |
| 10 | 10 | homepage.slug = profile.identifier |
| ... | ... | @@ -12,7 +12,7 @@ class Profile < ActiveRecord::Base |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | after_destroy do |profile| |
| 15 | - Comatose::Page.find_by_path(profile.identifier).destroy | |
| 15 | + Article.find_by_path(profile.identifier).destroy | |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | # Valid identifiers must match this format. |
| ... | ... | @@ -65,4 +65,21 @@ class Profile < ActiveRecord::Base |
| 65 | 65 | find_tagged_with(term) + find_all_by_name(term) |
| 66 | 66 | end |
| 67 | 67 | |
| 68 | + # Returns information about the profile's owner that was made public by | |
| 69 | + # him/her. The returned value must be an array in the followinf format: | |
| 70 | + # | |
| 71 | + # [ | |
| 72 | + # [ 'First Field', first_field_value ], | |
| 73 | + # [ 'Second Field', second_field_value ], | |
| 74 | + # ] | |
| 75 | + # | |
| 76 | + # This information shall be used by user interface to present the information | |
| 77 | + # | |
| 78 | + # In this class, this method returns nil, what is interpreted as "no | |
| 79 | + # information at all". Subclasses must override this method to provide their | |
| 80 | + # specific information. | |
| 81 | + def info | |
| 82 | + nil | |
| 83 | + end | |
| 84 | + | |
| 68 | 85 | end | ... | ... |