Commit 343093b3074f8d9cfda42c564660a1776b244ba8
1 parent
9430f210
Exists in
master
and in
29 other branches
ActionItem41: using the settings module to implement a description field in Community class
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1319 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
11 additions
and
1 deletions
Show diff stats
app/models/community.rb
app/models/profile.rb
@@ -18,6 +18,8 @@ class Profile < ActiveRecord::Base | @@ -18,6 +18,8 @@ class Profile < ActiveRecord::Base | ||
18 | 18 | ||
19 | acts_as_searchable :fields => [ :name, :identifier ] | 19 | acts_as_searchable :fields => [ :name, :identifier ] |
20 | 20 | ||
21 | + acts_as_having_settings :field => :data | ||
22 | + | ||
21 | # Valid identifiers must match this format. | 23 | # Valid identifiers must match this format. |
22 | IDENTIFIER_FORMAT = /^[a-z][a-z0-9]+([_-][a-z0-9]+)*$/ | 24 | IDENTIFIER_FORMAT = /^[a-z][a-z0-9]+([_-][a-z0-9]+)*$/ |
23 | 25 |
test/unit/community_test.rb
@@ -12,4 +12,10 @@ class CommunityTest < Test::Unit::TestCase | @@ -12,4 +12,10 @@ class CommunityTest < Test::Unit::TestCase | ||
12 | assert_equal 'my-shiny-new-community', c.identifier | 12 | assert_equal 'my-shiny-new-community', c.identifier |
13 | end | 13 | end |
14 | 14 | ||
15 | + should 'have a description attribute' do | ||
16 | + c = Community.new | ||
17 | + c.description = 'the description of the community' | ||
18 | + assert_equal 'the description of the community', c.description | ||
19 | + end | ||
20 | + | ||
15 | end | 21 | end |