Permalink
Browse files

Merge branch 'master' of https://github.com/viatropos/tower into feat…

…ure/socket-client-server
  • Loading branch information...
2 parents 43beb83 + ffef44f commit 9e9d3ba01738cdc269133081fbd916cb0cce2192 @sebastianhoitz sebastianhoitz committed Apr 9, 2012
@@ -216,6 +216,7 @@ Tower.Store.MongoDB.Serialization = {
}
},
_encodeId: function(value) {
+ if (typeof value === 'number') return value;
try {
return this.constructor.database.bson_serializer.ObjectID(value);
} catch (error) {
@@ -54,6 +54,8 @@ class Tower.Model.Validator
new @Format(name, value, attributes, options)
when 'in', 'except', 'only', 'notIn', 'values', 'accepts'
new @Set(name, value, attributes, options)
+ when 'uniqueness', 'unique'
+ new @Uniqueness(name, value, attributes, options)
constructor: (name, value, attributes, options = {}) ->
@name = name
@@ -196,6 +196,7 @@ Tower.Store.MongoDB.Serialization =
# @todo need to figure out a better way to do this.
_encodeId: (value) ->
+ return value if typeof value == 'number'
try
@constructor.database.bson_serializer.ObjectID(value)
catch error

0 comments on commit 9e9d3ba

Please sign in to comment.