Commit 241766d6b308bb9afa1ab68087db81e08bfd9e33

Authored by AntonioTerceiro
1 parent f271ac23

ActionItem9: refactoring: removing acts_as_configurable and using a plain Hash



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@107 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/virtual_community.rb
... ... @@ -16,12 +16,14 @@ class VirtualCommunity < ActiveRecord::Base
16 16 # One VirtualCommunity can be reached by many domains
17 17 has_many :domains, :as => :owner
18 18  
19   - # a VirtualCommunity can be configured
20   - acts_as_configurable
21   -
22 19 # #################################################
23 20 # Attributes
24 21 # #################################################
  22 +
  23 + serialize :settings
  24 + def settings
  25 + self[:settings] ||= {}
  26 + end
25 27  
26 28 # Enables a feature
27 29 def enable(feature)
... ...
db/migrate/001_create_virtual_communities.rb
1 1 class CreateVirtualCommunities < ActiveRecord::Migration
2 2 def self.up
3 3 create_table :virtual_communities do |t|
4   - t.column :name, :string
  4 + t.column :name, :string
5 5 t.column :is_default, :boolean
  6 + t.column :settings, :text
6 7 end
7 8 VirtualCommunity.create(:name => 'Default Virtual Community', :is_default => true)
8   - ConfigurableSetting.create_table
9 9 end
10 10  
11 11 def self.down
12   - ConfigurableSetting.drop_table
13 12 drop_table :virtual_communities
14 13 end
15 14 end
... ...