Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ure/socket-client-server
  • Loading branch information...
commit 9e9d3ba01738cdc269133081fbd916cb0cce2192 2 parents 43beb83 + ffef44f
Sebastian Hoitz sebastianhoitz authored
1  lib/tower/server/store/mongodb/serialization.js
View
@@ -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) {
2  src/tower/model/validator.coffee
View
@@ -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
1  src/tower/server/store/mongodb/serialization.coffee
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.