Setting default model type name to 'model'

This commit is contained in:
Sam Lown 2011-04-18 22:29:25 +02:00
parent 3764d1cd5c
commit bc4c8719d0
7 changed files with 25 additions and 9 deletions

View file

@ -13,7 +13,7 @@ module CouchRest
add_config :auto_update_design_doc
configure do |config|
config.model_type_key = 'couchrest-type' # 'model'?
config.model_type_key = 'model' # was 'couchrest-type'
config.mass_assign_any_attribute = false
config.auto_update_design_doc = true
end

View file

@ -116,6 +116,7 @@ module CouchRest
module ClassMethods
def property(name, *options, &block)
raise "Invalid property definition, '#{name}' already used for CouchRest Model type field" if name.to_s == model_type_key.to_s
opts = { }
type = options.shift
if type.class != Hash