<commit_before>//
//  Specialist.swift
//  SmartCollaborationVapor
//
//  Created by <NAME> on 28/02/2017.
//
//

import Vapor
import Fluent
import Turnstile
import TurnstileCrypto
import Auth

final class Specialist: Model, User {
    
    var id: Node?
    var email: String
    var password: String
    var club: String
    var exists: Bool = false
    
    init(email: String, password: String, club: String) {
        self.email = email
        self.password = BCrypt.hash(password: password)
        self.club = club
    }
    
    init(node: Node, in context: Context) throws {
        id = try node.extract("id")
        email = try node.extract("email")
        password = try node.extract("password")
        club = try node.extract("club")
    }
    
    func makeNode(context: Context) throws -> Node {
        return try Node(node: [
            "id": id,
            "email": email,
            "password": password,
            "club": club
            ])
    }
    
    static func prepare(_ database: Database) throws {
        try database.create("specialists") { specialists in
            specialists.id()
            specialists.string("email")
            specialists.string("password")
            specialists.string("club")
        }
    }
    
    static func revert(_ database: Database) throws {
        try database.delete("specialists")
    }
    
    static func register(email: String, password: String, club: String) throws -> Specialist {
        var newUser = try Specialist(email: email, password: password, club: club)<commit_msg>minor update to renove compile-time warnings<commit_after>//
//  Specialist.swift
//  SmartCollaborationVapor
//
//  Created by <NAME> on 28/02/2017.
//
//

import Vapor
import Fluent
import Turnstile
import TurnstileCrypto
import Auth

final class Specialist: Model, User {
    
    var id: Node?
    var email: String
    var password: String
    var club: String
    var exists: Bool = false
    
    init(email: String, password: String, club: String) {
        self.email = email
        self.password = <PASSWORD>(password: password)
        self.club = club
    }
    
    init(node: Node, in context: Context) throws {
        id = try node.extract("id")
        email = try node.extract("email")
        password = try node.extract("password")
        club = try node.extract("club")
    }
    
    func makeNode(context: Context) throws -> Node {
        return try Node(node: [
            "id": id,
            "email": email,
            "password": password,
            "club": club
            ])
    }
    
    static func prepare(_ database: Database) throws {
        try database.create("specialists") { specialists in
            specialists.id()
            specialists.string("email")
            specialists.string("password")
            specialists.string("club")
        }
    }
    
    static func revert(_ database: Database) throws {
        try database.delete("specialists")
    }
    
    static func register(email: String, password: String, club: String) throws -> Specialist {
        var newUser = Specialist(email: email, password: password, club: club)
{'fraction_non_alphanumeric': 0.10702976567447751, 'fraction_numerical': 0.00506649778340722, 'mean_word_length': 2.1370407149950346, 'pattern_counts': {'":': 8, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3933829', 'n_tokens_mistral': 878, 'n_tokens_neox': 865, 'n_words': 257}