summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-20 08:40:33 +0100
committerspag <spag@golwen.net>2013-02-20 08:40:33 +0100
commit32fac3575ab52dba1a39925d61465702ee11eb9c (patch)
tree12adef2824f3872ae1cd1d781c38bdc9c0fcf23a
parentaa54ca3ea7b726d6e9c411ed41952ac8b483484c (diff)
entity, section added
-rw-r--r--app/models/gs_parameter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/gs_parameter.rb b/app/models/gs_parameter.rb
index fe2a845..cd4f47b 100644
--- a/app/models/gs_parameter.rb
+++ b/app/models/gs_parameter.rb
@@ -10,9 +10,13 @@ class GsParameter < ActiveRecord::Base
:presence => true,
:inclusion => { :in => ['String', 'Integer', 'Boolean', 'YAML', 'Nil'] }
- def self.get(wanted_variable)
+ def self.get(wanted_variable, entity=nil, section=nil)
if GsParameter.table_exists?
- item = GsParameter.where(:name => wanted_variable).first
+ if entity || section
+ item = GsParameter.where(:name => wanted_variable, :entity => entity, :section => section).first
+ else
+ item = GsParameter.where(:name => wanted_variable).first
+ end
if item.nil? || item.class_type == 'Nil'
return nil
else