apply sho's patch: default values may be lambdas
This commit is contained in:
commit
5e7f61d332
2 changed files with 6 additions and 1 deletions
|
@ -510,6 +510,11 @@ module CouchRest
|
|||
if self.class.default
|
||||
self.class.default.each do |k,v|
|
||||
self[k] = v unless self.key?(k.to_s)
|
||||
if v.class == Proc
|
||||
self[k.to_s] = v.call
|
||||
else
|
||||
self[k.to_s] = Marshal.load(Marshal.dump(v))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue