Merge branch 'master' into adv_design
This commit is contained in:
commit
a79c2d516a
5 changed files with 27 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue