Skip to content

Commit

Permalink
Merge pull request #579 from zdnk/bugfix/crud-operations-return
Browse files Browse the repository at this point in the history
Return updated/created/saved model from Future
  • Loading branch information
0xTim authored Oct 29, 2018
2 parents dc258fe + cb9c285 commit 8c2d383
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Fluent/Model/Model+CRUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ extension Future where T: Model {
/// See `Model`.
public func save(on connectable: DatabaseConnectable) -> Future<T> {
return self.flatMap(to: T.self) { (model) in
return model.save(on: connectable).transform(to: model)
return model.save(on: connectable)
}
}

/// See `Model`.
public func create(on connectable: DatabaseConnectable) -> Future<T> {
return self.flatMap(to: T.self) { (model) in
return model.create(on: connectable).transform(to: model)
return model.create(on: connectable)
}
}

/// See `Model`.
public func update(on connectable: DatabaseConnectable) -> Future<T> {
return self.flatMap(to: T.self) { (model) in
return model.update(on: connectable).transform(to: model)
return model.update(on: connectable)
}
}

Expand Down

0 comments on commit 8c2d383

Please sign in to comment.