From 9f54ec26e2de0e48b8c779ff83f85c6fb425a292 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Mon, 28 Jan 2019 20:10:15 +0900 Subject: [PATCH] add Where initializer that can accept another Where clause --- Sources/Where.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/Where.swift b/Sources/Where.swift index 5e2da49..81df48b 100644 --- a/Sources/Where.swift +++ b/Sources/Where.swift @@ -121,6 +121,16 @@ public struct Where: WhereClauseType, FetchClause, QueryClause self.init(true) } + + /** + Initializes a `Where` clause with an existing `Where` clause. + + - parameter clause: the existing `Where` clause. + */ + public init(_ clause: Where) { + + self.init(clause.predicate) + } /** Initializes a `Where` clause with a predicate that always evaluates to the specified boolean value