Commit 7d54b7ccdfc00db75168014a1639d565da74c349
1 parent
895be993
Exists in
master
and in
28 other branches
ActionItem43: tell wheter a profile has members or not
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1341 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
22 additions
and
0 deletions
Show diff stats
app/models/organization.rb
app/models/profile.rb
... | ... | @@ -221,4 +221,11 @@ class Profile < ActiveRecord::Base |
221 | 221 | articles.select {|item| item.tags.map(&:name).include?(tag) } |
222 | 222 | end |
223 | 223 | |
224 | + # Tells whether a specified profile has members or nor. | |
225 | + # | |
226 | + # On this class, returns <tt>false</tt> by default. | |
227 | + def has_members? | |
228 | + false | |
229 | + end | |
230 | + | |
224 | 231 | end | ... | ... |
test/unit/organization_test.rb
test/unit/profile_test.rb
... | ... | @@ -309,6 +309,10 @@ class ProfileTest < Test::Unit::TestCase |
309 | 309 | assert_kind_of Role, Profile::Roles.member |
310 | 310 | end |
311 | 311 | |
312 | + should 'not have members by default' do | |
313 | + assert_equal false, Profile.new.has_members? | |
314 | + end | |
315 | + | |
312 | 316 | private |
313 | 317 | |
314 | 318 | def assert_invalid_identifier(id) | ... | ... |