wrest
wrest copied to clipboard
always_has should support setting a default value
for example class Foo always_has :tags, :default => [] end
I think a small change can simplify the implementation:
class Foo
always_has :tags => []
end
If the entry is a hash we use it's key as the attribute name and corresponding value as the default value. If it's just a symbol then we use it as only an attribute name.