diff options
author | spag <spag@golwen.net> | 2013-02-20 08:40:33 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-02-20 08:40:33 +0100 |
commit | 32fac3575ab52dba1a39925d61465702ee11eb9c (patch) | |
tree | 12adef2824f3872ae1cd1d781c38bdc9c0fcf23a | |
parent | aa54ca3ea7b726d6e9c411ed41952ac8b483484c (diff) |
entity, section added
-rw-r--r-- | app/models/gs_parameter.rb | 8 |
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 |