ocean-rails 2.1.1 → 2.1.2

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: ee568551ab7cc1568b5a5f42ed9fb178059f454e
4
- data.tar.gz: 8bcdd5311573411e7de5a5be71b7749a560c0986
3
+ metadata.gz: 1c3ae94042c710802aa3e4ae565a82daad1d252a
4
+ data.tar.gz: c7f81b494efb7a75be1d89ddb83196e3db5f5318
5
5
  SHA512:
6
- metadata.gz: 3d8ad03e2440314d32da75347424f88519f576190d269dd5157b0e0365f62a891231afe15962dee612e1682e562cf0eb3850a3bc5dcc1bd1257b06bfa96840c6
7
- data.tar.gz: 511d8a48333a4b1309031a1e82c290b31fed9f2c35b2608a407e26c081cd170ad1eeec3ba6cf173bbb496db5fafd2322b20a12ab7b55ee1cfd61f6433fa86ed8
6
+ metadata.gz: e64edcb5dcd728fe6f5715d8e39d02c96bc31844fdd62819af1b614dec2e8caba7afc2072b7510d7a855430d89ffadb6860efa9c8384e331bfcc1e8ac0396994
7
+ data.tar.gz: 6caa66fdbac4ff464a0ec76b6c42327338577e6965fdc49a0c10775e9ba71d437b59475f8e4e93abe411b751639264a4522d9a91cf300f48b8b5ddf45a6a1f58
@@ -178,10 +178,6 @@ module OceanApplicationController
178
178
  locals: {m.class.model_name.i18n_key => m}) }
179
179
  count = resources.count
180
180
  total_count = x.unscope(:limit, :offset).count
181
- # page = nil
182
- # page_size = nil
183
- # prev_page = nil
184
- # next_page = nil
185
181
  attrs = {count: count,
186
182
  total_count: total_count
187
183
  }
@@ -194,7 +190,7 @@ module OceanApplicationController
194
190
  total_pages = (total_count.to_f / page_size.to_f).ceil
195
191
  last_page = total_pages - 1
196
192
  prev_page = page > 0 && page - 1
197
- next_page = page != last_page && page + 1
193
+ next_page = page < last_page && page + 1
198
194
  links['first_page'] = {href: url_for(params.merge(page: 0)), type: 'application/json'}
199
195
  links['last_page'] = {href: url_for(params.merge(page: last_page)), type: 'application/json'}
200
196
  links['previous_page'] = {href: url_for(params.merge(page: prev_page)), type: 'application/json'} if prev_page
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson