paginated 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paginated/serialization.rb +1 -1
- data/lib/paginated.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ae94c2ae8e872f233996072ec628db19b885a8538cafcf7ff3b75a2af99b933
|
4
|
+
data.tar.gz: 2fd627408f5ad65ae5da8e72fd9b393db0e8cdaf7f2d1b073f02135ce37ea474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f73355fbbeda03857a8948618625392f69749f4bb968d9c4248662c31703db94cadb3a115013419d24b9fce418edf6db4db8c91dcbd6de855fae22a77a473ce0
|
7
|
+
data.tar.gz: 1297773a18228ed479111c7cc84fad0a500cfd4af7c87d456e9abe5cc825bdd161716b31b5ffa8ec53c352e0a2b81c8bd94e959c15e552f8ac733a346991e702
|
@@ -37,7 +37,7 @@ module Serialization
|
|
37
37
|
|
38
38
|
def serialize_with_entity
|
39
39
|
entity = @attrs[:entity].constantize
|
40
|
-
@objects = @objects.map { |i| entity.represent(i).as_json }
|
40
|
+
@objects = @objects.map { |i| entity.represent(i, current_user: @current_user).as_json }
|
41
41
|
end
|
42
42
|
|
43
43
|
def sort_proc
|
data/lib/paginated.rb
CHANGED
@@ -8,9 +8,10 @@ class Paginated
|
|
8
8
|
|
9
9
|
def collection(**attrs)
|
10
10
|
@attrs = attrs
|
11
|
+
@params = attrs[:serialization_scope].params.stringify_keys
|
12
|
+
@current_user = attrs[:serialization_scope].current_user
|
11
13
|
@fields = attrs[:fields]
|
12
14
|
@scopes = attrs[:scopes] || {}
|
13
|
-
@params = attrs[:params].stringify_keys
|
14
15
|
@offset = @params['offset'].to_i
|
15
16
|
@limit = @params['limit'] || 20
|
16
17
|
@order = attrs[:order] || :id
|