effective_datatables 3.0.4 → 3.0.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: ecb3b1a263285ad9acc6a96b65a75aed66f16023
4
- data.tar.gz: 8bea0658d45b252bf91fedda6fe708d5b5abc8d4
3
+ metadata.gz: 9661a4c6eba5a48628670afc02bbfed2288ffd1e
4
+ data.tar.gz: 688f0281eb5be12a2d80d3405043529906651a57
5
5
  SHA512:
6
- metadata.gz: eabae653bd9cd35abc5b54a9596655d27ee0422cb170b8df40cd2680f8200f2c3a8e7ee866691e61f98ccd00f06d81b100dee0a8eba9d0cc82d4646e33014fed
7
- data.tar.gz: ad4c8278fa5c7ce2987901d38167966c749036a49e8867a8dcf1a900411adbbec44c1c17f04f2691afad1f997a16d522131c9530fea6c03027834bcf838469b2
6
+ metadata.gz: 692fb8fcd1cfc8c68bde471887525fa280ecef5266f279e3be86db5d13dc8311a57fa37aedf08d9f0e8ea69bd827364c65f4379e705992e97f0d92772d6ac513
7
+ data.tar.gz: 048b6b8dea7fa887d35ceb37f7b649471d1d0749f2154d954495ef0dc2fe290c4c6faceb07f10f32ca6ae1d02ff87b0106487945ce1dd671031b4468f8ee0bb1
@@ -125,7 +125,10 @@ module Effective
125
125
  end
126
126
 
127
127
  def paginate(collection)
128
- Kaminari.paginate_array(collection).page(datatable.page).per(datatable.per_page)
128
+ page = [datatable.page.to_i - 1, 0].max
129
+ per_page = datatable.per_page.to_i
130
+
131
+ collection[(page * per_page)...((page * per_page) + per_page)]
129
132
  end
130
133
 
131
134
  def size(collection)
@@ -1,4 +1,3 @@
1
- require 'haml-rails'
2
1
  require 'kaminari'
3
2
  require 'simple_form'
4
3
  require 'effective_resources'
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.0.4'.freeze
2
+ VERSION = '3.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.3.0
55
- - !ruby/object:Gem::Dependency
56
- name: kaminari
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: sass-rails
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: haml-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "<"
88
- - !ruby/object:Gem::Version
89
- version: 1.0.0
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "<"
95
- - !ruby/object:Gem::Version
96
- version: 1.0.0
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: simple_form
99
71
  requirement: !ruby/object:Gem::Requirement