wor-paginate 0.1.5a → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -2
- data/README.md +0 -14
- data/lib/wor/paginate/formatter.rb +1 -1
- data/lib/wor/paginate/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e642dcd7e5593d0db78018d072f65cf1f0ead2393bed43e3c474c72738c06710
|
|
4
|
+
data.tar.gz: 970b90f2c5dce5a30e250bb294c0cc83e67a8c742ccf47abf091b3243e572492
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4ec15809e387854ec114da96b562bb8136e4a840e8112b0d4c7e2e2dd3120c097740e0559caf93b4477b6059fc9377d200a2988a6c465f30d504dbf912ab77e
|
|
7
|
+
data.tar.gz: f0e1ff9a99b57c4fa52a336bba2a3d13e7e1d79b493c39cb5e21b80b47fee7df5229ea01786f1100ac94c199f4c6322de9b4aca8c03088c3e41e44336aabd321
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
## Change log
|
|
2
2
|
|
|
3
|
-
### V0.1.5a
|
|
4
|
-
* [#62](https://github.com/Wolox/wor-paginate/pull/62): Add options in active model serializer - [@blacksam07](https://github.com/blacksam07).
|
|
5
3
|
|
|
6
4
|
### V0.1.5
|
|
7
5
|
* [#59](https://github.com/Wolox/wor-paginate/pull/59): Add include option to serialize nested models - [@jcgrethe](https://github.com/jcgrethe).
|
data/README.md
CHANGED
|
@@ -104,20 +104,6 @@ render_paginated DummyModel, each_serializer: CustomDummyModelSerializer
|
|
|
104
104
|
```
|
|
105
105
|
where the serializer is just an [`ActiveModel::Serializer`](https://github.com/rails-api/active_model_serializers).
|
|
106
106
|
|
|
107
|
-
#### Custom options
|
|
108
|
-
Using custom options in serializer, example method `current_user`
|
|
109
|
-
```ruby
|
|
110
|
-
render_paginated DummyModel, each_serializer: CustomDummyModelSerializer, current_user: current_user
|
|
111
|
-
```
|
|
112
|
-
In serializer
|
|
113
|
-
```ruby
|
|
114
|
-
class CustomSerializer < ActiveModel::Serializer
|
|
115
|
-
def method
|
|
116
|
-
@instance_options[:current_user]
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
```
|
|
120
|
-
|
|
121
107
|
#### Custom formatters
|
|
122
108
|
A formatter is an object that defines the output of the render_paginated method. In case the application needs a different format for a request, it can be passed to the `render_paginated` method using the `formatter` option:
|
|
123
109
|
```ruby
|
|
@@ -33,7 +33,7 @@ module Wor
|
|
|
33
33
|
|
|
34
34
|
def serialized_content
|
|
35
35
|
if serializer.present?
|
|
36
|
-
return paginated_content.map { |item| serializer.new(item, options) }
|
|
36
|
+
return paginated_content.map { |item| serializer.new(item, scope: options[:scope]) }
|
|
37
37
|
end
|
|
38
38
|
if defined? ActiveModelSerializers::SerializableResource
|
|
39
39
|
ActiveModelSerializers::SerializableResource.new(paginated_content).as_json
|
data/lib/wor/paginate/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wor-paginate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- icoluccio
|
|
@@ -103,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
103
103
|
version: '0'
|
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements:
|
|
106
|
-
- - "
|
|
106
|
+
- - ">="
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
|
-
version:
|
|
108
|
+
version: '0'
|
|
109
109
|
requirements: []
|
|
110
110
|
rubygems_version: 3.0.2
|
|
111
111
|
signing_key:
|