hal_api-rails 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hal_api-rails.gemspec +1 -1
- data/lib/hal_api/rails/version.rb +1 -1
- data/lib/hal_api/representer/embeds.rb +3 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19cfd5d88b89d4ef4cb6266c1b99504759ebe9f6
|
4
|
+
data.tar.gz: 8f9252058b5147d0fc68cde33ce6d0a00cc2c451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ea78ca42990363713271298545de90d6d7a1509d675976da965f781c1a746b5a42757ccd06e44934aa6d0e3ff1e317af383d6efd6dec9c439d24bf2f1709d56
|
7
|
+
data.tar.gz: 6a237f1f26ef95e4aa3f3dfc5187c246e8a5af4dc12491a68ee6603472cdb699453130e95a32696257a4ae13086449bab5bdd49696b5d258698fb7617c45534d
|
data/hal_api-rails.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
-
spec.add_development_dependency "rails", "~> 4.2
|
32
|
+
spec.add_development_dependency "rails", "~> 4.2"
|
33
33
|
spec.add_development_dependency "pry-byebug"
|
34
34
|
spec.add_development_dependency "minitest"
|
35
35
|
spec.add_development_dependency "kaminari"
|
@@ -77,7 +77,9 @@ module HalApi::Representer::Embeds
|
|
77
77
|
options[:getter] ||= ->(*) do
|
78
78
|
cnt = send(name).count
|
79
79
|
per = getter_per == :all ? cnt : getter_per
|
80
|
-
if cnt
|
80
|
+
if cnt == 0
|
81
|
+
items = send(name).page(1).per(Kaminari.config.default_per_page)
|
82
|
+
elsif cnt <= per
|
81
83
|
items = Kaminari.paginate_array(send(name)).page(1).per(per)
|
82
84
|
else
|
83
85
|
items = send(name).page(1).per(per)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal_api-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rhoden
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -143,14 +143,14 @@ dependencies:
|
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 4.2
|
146
|
+
version: '4.2'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 4.2
|
153
|
+
version: '4.2'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: pry-byebug
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
version: '0'
|
253
253
|
requirements: []
|
254
254
|
rubyforge_project:
|
255
|
-
rubygems_version: 2.
|
255
|
+
rubygems_version: 2.6.14.4
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: JSON HAL APIs on Rails in the style of PRX
|