{"size": 581, "ext": "js", "max_stars_repo_path": "api/models/User.js", "max_stars_repo_name": "Yomguithereal/mtgnode", "max_stars_repo_stars_event_min_datetime": "2015-01-11T19:25:18.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-06T07:30:21.000Z", "max_issues_repo_path": "api/models/User.js", "max_issues_repo_name": "Yomguithereal/mtgnode", "max_issues_repo_issues_event_min_datetime": "2017-08-06T12:22:27.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-05T08:18:23.000Z", "max_forks_repo_path": "api/models/User.js", "max_forks_repo_name": "Yomguithereal/mtgnode", "max_forks_repo_forks_event_min_datetime": "2015-01-12T11:13:15.000Z", "max_forks_repo_forks_event_max_datetime": "2020-09-10T17:25:50.000Z"}
{"max_stars_count": 37, "max_issues_count": 3, "max_forks_count": 24, "avg_line_length": 21.5185185185, "max_line_length": 77, "alphanum_fraction": 0.430292599}
/*
| -------------------------------------------------------------------
|  MTGNode User Model
| -------------------------------------------------------------------
|
| Author : Yomguithereal
| Version : 1.0
*/

module.exports = {
  attributes: {
    username: 'String',
    password: {
      type: 'String',
      defaultsTo: 'test'
    },
    decks: function(cb) {
      Deck.find({user_id: this.id}, cb);
    }
  },
  authenticate: function(username, password, cb) {
    this.findOne({username: username, password: password}, function(err, u) {
      cb(err, u);
    });
  }
};
