From 27d39089de2f049b1b2ea279f67dfcb8ba3d3e60 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 23 Jul 2007 20:35:09 +0000 Subject: [PATCH] ActionItem3: better documentation for VirtualCommunity model --- app/models/virtual_community.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/models/virtual_community.rb b/app/models/virtual_community.rb index fff9c93..ac859d3 100644 --- a/app/models/virtual_community.rb +++ b/app/models/virtual_community.rb @@ -1,3 +1,6 @@ +# A VirtualCommunity is like a website to be hosted in the platform. It may +# contain multiple Profile's and can be identified by several different +# domains. class VirtualCommunity < ActiveRecord::Base # returns the available features for a VirtualCommunity, in the form of a @@ -20,22 +23,25 @@ class VirtualCommunity < ActiveRecord::Base # Attributes # ################################################# + # store the VirtualCommunity settings as YAML-serialized Hash. serialize :settings + + # returns a Hash containing the VirtualCommunity configuration def settings self[:settings] ||= {} end - # Enables a feature + # Enables a feature identified by its name def enable(feature) self.settings["#{feature}_enabled"] = true end - # Disables a feature + # Disables a feature identified by its name def disable(feature) self.settings["#{feature}_enabled"] = false end - # Tells if a feature is enabled + # Tells if a feature, identified by its name, is enabled def enabled?(feature) self.settings["#{feature}_enabled"] == true end -- libgit2 0.21.2