Skip to content

Instantly share code, notes, and snippets.

@bennibau
Created September 5, 2017 16:51
Show Gist options
  • Save bennibau/ee74eec828b599f6f6f93779a0dc0a07 to your computer and use it in GitHub Desktop.
Save bennibau/ee74eec828b599f6f6f93779a0dc0a07 to your computer and use it in GitHub Desktop.
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