diff --git a/app/models/community.rb b/app/models/community.rb index ba6936c..421c214 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -1,4 +1,6 @@ -class Community < Profile +class Community < Organization + + settings_items :description def name=(value) super(value) diff --git a/app/models/profile.rb b/app/models/profile.rb index 927c002..6b8b621 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -18,6 +18,8 @@ class Profile < ActiveRecord::Base acts_as_searchable :fields => [ :name, :identifier ] + acts_as_having_settings :field => :data + # Valid identifiers must match this format. IDENTIFIER_FORMAT = /^[a-z][a-z0-9]+([_-][a-z0-9]+)*$/ diff --git a/test/unit/community_test.rb b/test/unit/community_test.rb index 987adaf..a493cd0 100644 --- a/test/unit/community_test.rb +++ b/test/unit/community_test.rb @@ -12,4 +12,10 @@ class CommunityTest < Test::Unit::TestCase assert_equal 'my-shiny-new-community', c.identifier end + should 'have a description attribute' do + c = Community.new + c.description = 'the description of the community' + assert_equal 'the description of the community', c.description + end + end -- libgit2 0.21.2