userbin 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/userbin/client.rb +3 -0
- data/lib/userbin/configuration.rb +1 -1
- data/lib/userbin/models/model.rb +16 -0
- data/lib/userbin/session_token.rb +4 -0
- data/lib/userbin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfd28539bb9186bc657716210bd030988b426fc6
|
4
|
+
data.tar.gz: a96543da7ea30326ab56c7f44decfa1900fd34e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5088cf23603aef48e2a00bd3ee2210a79c5da474ca972779bdcb5d44b94b2b97283441096487e024e5420b2c75e750500e6a9f59c4a008de9afc9907c7ee7daa
|
7
|
+
data.tar.gz: c55e51b05eada68f32b5a4ef52747b57e8d652090ed6e87432e97cb16a0ab8fa8395564caf53c59dcfd97a6a85cbc40943b355c5f69c6f6ac170d2349111fa7f
|
data/lib/userbin/client.rb
CHANGED
data/lib/userbin/models/model.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
require 'her'
|
2
2
|
|
3
|
+
class Her::Collection
|
4
|
+
# Call the overridden to_json in Userbin::Model
|
5
|
+
def to_json
|
6
|
+
self.map { |m| m.to_json }
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
3
10
|
module Userbin
|
4
11
|
class Model
|
5
12
|
include Her::Model
|
@@ -11,6 +18,15 @@ module Userbin
|
|
11
18
|
super(args)
|
12
19
|
end
|
13
20
|
|
21
|
+
# Remove the auto-generated embedded User model to prevent recursion
|
22
|
+
def to_json
|
23
|
+
attrs = attributes
|
24
|
+
if attrs['user'] && attrs['user']['id'] == 'current'
|
25
|
+
attrs.delete 'user'
|
26
|
+
end
|
27
|
+
attrs.to_json
|
28
|
+
end
|
29
|
+
|
14
30
|
METHODS.each do |method|
|
15
31
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
16
32
|
def self.instance_#{method}(action)
|
data/lib/userbin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: userbin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: her
|