Merge branch 'master' into adv_design

This commit is contained in:
Sam Lown 2011-02-05 22:39:04 +01:00
commit a79c2d516a
5 changed files with 27 additions and 6 deletions

View file

@ -156,7 +156,11 @@ module CouchRest
type = Class.new(Hash) do
include CastedModel
end
type.class_eval { yield type }
if block.arity == 1 # Traditional, with options
type.class_eval { yield type }
else
type.instance_exec(&block)
end
type = [type] # inject as an array
end
property = Property.new(name, type, options)