Commit c86e4879cee472409bb2e8a400d67a7f2a379810
1 parent
ae09bca9
Exists in
staging
and in
42 other branches
ActionItem3: VirtualCommunity acts as configurable
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@47 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
5 additions
and
0 deletions
Show diff stats
app/models/virtual_community.rb
| @@ -3,6 +3,9 @@ class VirtualCommunity < ActiveRecord::Base | @@ -3,6 +3,9 @@ class VirtualCommunity < ActiveRecord::Base | ||
| 3 | # One VirtualCommunity can be reached by many domains | 3 | # One VirtualCommunity can be reached by many domains |
| 4 | has_many :domains, :as => :owner | 4 | has_many :domains, :as => :owner |
| 5 | 5 | ||
| 6 | + # a VirtualCommunity can be configured | ||
| 7 | + acts_as_configurable | ||
| 8 | + | ||
| 6 | # <tt>name</tt> is mandatory | 9 | # <tt>name</tt> is mandatory |
| 7 | validates_presence_of :name | 10 | validates_presence_of :name |
| 8 | 11 |
db/migrate/001_create_virtual_communities.rb
| @@ -5,9 +5,11 @@ class CreateVirtualCommunities < ActiveRecord::Migration | @@ -5,9 +5,11 @@ class CreateVirtualCommunities < ActiveRecord::Migration | ||
| 5 | t.column :configuration, :text | 5 | t.column :configuration, :text |
| 6 | t.column :is_default, :boolean | 6 | t.column :is_default, :boolean |
| 7 | end | 7 | end |
| 8 | + ConfigurableSetting.create_table | ||
| 8 | end | 9 | end |
| 9 | 10 | ||
| 10 | def self.down | 11 | def self.down |
| 12 | + ConfigurableSetting.drop_table | ||
| 11 | drop_table :virtual_communities | 13 | drop_table :virtual_communities |
| 12 | end | 14 | end |
| 13 | end | 15 | end |