koa-js 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0208406940feffa76b48e9d8458b9859f7176c51
4
- data.tar.gz: 9da657b2d4ac6704466e477df209c0086dd1f18d
3
+ metadata.gz: 763b3d4d0f0e1bdab2c56d0044308e3ef0979b23
4
+ data.tar.gz: 89f003532854ca317d3e215a1015529c1c364b65
5
5
  SHA512:
6
- metadata.gz: bdc09e801ecadb72017f83c5fb7785ecc8e89eccfcd4cfc175a7f93dc0b767ba80b78206dc452c43a31f5cd4c5a4bddd8982bad101b80f5bf19d85c9c518b566
7
- data.tar.gz: 01eb3bfddf13383180694bfc5f06cedf75387a77c4abc65d586a295a5c51855c5859047427b35c2adc7959400865acd60111a5aeafa4cf4741f7c3ffa7d0a57f
6
+ metadata.gz: 3301d702be6f8224b3836c4c8dcb51dffb08c95ac66abba164ff30658306348db1668f288ea8e6b9b10eabdcca416157604aba1395583cb2dfabca72c92df0a7
7
+ data.tar.gz: 00791e3a904eb15f2822799d66b7f2382fb849b6cf502a51b7b9ff416056422eb04e86499d43c6e08959e11a1398e1eeeed25a46bc5254f2079047ef2955c2b4
@@ -66,6 +66,21 @@ var KOAUser = KOAModel.extend({
66
66
  },
67
67
 
68
68
  instance: {
69
+ load: function(callback) {
70
+ if(this.id) {
71
+ if(callback) return callback(null, this);
72
+ }
73
+ var _this = this;
74
+ API.getUser(this, function(err, user) {
75
+ if(err) {
76
+ if(callback) return callback(err);
77
+ return;
78
+ }
79
+ _this.id = user.id;
80
+ if(callback) callback(null, _this);
81
+ });
82
+ },
83
+
69
84
  getPic: function() {
70
85
  if(!this.pic || this.pic == "null") {
71
86
  return "/img/default-pic.png";
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koa-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Rykwalder