Created
September 5, 2017 16:51
-
-
Save bennibau/ee74eec828b599f6f6f93779a0dc0a07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LeafProvider | |
import FluentProvider | |
extension Config { | |
public func setup() throws { | |
// allow fuzzy conversions for these types | |
// (add your own types here) | |
Node.fuzzy = [JSON.self, Node.self] | |
try setupProviders() | |
try setupPreparations() | |
} | |
/// Configure providers | |
private func setupProviders() throws { | |
try addProvider(LeafProvider.Provider.self) | |
try addProvider(FluentProvider.Provider.self) | |
} | |
/// Add all models that should have their | |
/// schemas prepared before the app boots | |
private func setupPreparations() throws { | |
preparations.append(User.self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment