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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3384e1c3f25a55759d4dee753c4ff4461c47790
4
- data.tar.gz: db49716687ec2c401600e885d4c6a1ed9b5acfe4
3
+ metadata.gz: 19cfd5d88b89d4ef4cb6266c1b99504759ebe9f6
4
+ data.tar.gz: 8f9252058b5147d0fc68cde33ce6d0a00cc2c451
5
5
  SHA512:
6
- metadata.gz: 32eea6448c3b32c6f2ad25e6031040c5fe10bf0c8c11de77f5b0c1b83c9d5f381eb87574b41320cf8aa3c1739858b92f0153050860ae7e3f70601d75e34dd997
7
- data.tar.gz: 301c242a45939e7ee2f2997f3f64d59543fcbccf6694d5d34e3c9136c4294b091ebe02514dbec7977e40499e7d2f28481eeabce1d01c0ad9c6380dca85bcad94
6
+ metadata.gz: 1ea78ca42990363713271298545de90d6d7a1509d675976da965f781c1a746b5a42757ccd06e44934aa6d0e3ff1e317af383d6efd6dec9c439d24bf2f1709d56
7
+ data.tar.gz: 6a237f1f26ef95e4aa3f3dfc5187c246e8a5af4dc12491a68ee6603472cdb699453130e95a32696257a4ae13086449bab5bdd49696b5d258698fb7617c45534d
@@ -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.1"
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"
@@ -1,5 +1,5 @@
1
1
  module HalApi
2
2
  module Rails
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
@@ -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 <= per
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
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: 2018-11-16 00:00:00.000000000 Z
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.1
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.1
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.4.5.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