[#935] Setting improperly set up for default values
having a fixed call order resolves a problem where 'value=' was called before 'name=' resulting in no serialization
This commit is contained in:
parent
9fde11f950
commit
1e96ac9e06
|
@ -185,8 +185,10 @@ private
|
|||
def self.find_or_default(name)
|
||||
name = name.to_s
|
||||
raise "There's no setting named #{name}" unless @@available_settings.has_key?(name)
|
||||
setting = find_by_name(name)
|
||||
setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
|
||||
find_by_name(name) or new do |s|
|
||||
s.name = name
|
||||
s.value = @@available_settings[name]['default']
|
||||
end
|
||||
end
|
||||
|
||||
def self.cache_key(name)
|
||||
|
|
Loading…
Reference in New Issue