diff --git a/types.go b/types.go index 9096720..da5a2f8 100644 --- a/types.go +++ b/types.go @@ -25,7 +25,6 @@ type Database interface { // C(name string) Collection Name() string EnsureIndex(m ModelInterface, index ...Index) error - ValidateObject(m ModelInterface, changes bson.M) error ReadDocument(m ModelInterface, selector bson.M) error CreateDocument(m ModelInterface) error ReadCollection(results interface{}, filter bson.M, selector bson.M, offset int, limit int, sort []string, pipelineModifier PipelineModifierFunction) error diff --git a/validator.go b/validator.go index 5b13502..b2ea77d 100644 --- a/validator.go +++ b/validator.go @@ -6,7 +6,7 @@ import ( ) // ValidateObject validates object via validator tag and custom method -func (db *MgoDatabase) ValidateObject(m ModelInterface, changes bson.M) error { +func ValidateObject(db Database, m ModelInterface, changes bson.M) error { // first validate via struct tag validator := validator.New(&validator.Config{ TagName: "validator",