might 0.3.1 → 0.4.0
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/CHANGES.md +3 -0
- data/lib/might/paginator.rb +1 -20
- data/lib/might/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae3926df5c33265477c17c0e4a6fdf51bbce9be3
|
|
4
|
+
data.tar.gz: c83a4f1777d278ff57c90413eb83f4594e48ff4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc69eca7bb795d151954266c0983c524ad8be4d91402bd6a51632073dfea34b0d82be496870e114c3344149dbab105118ed8f68aab72dadc34dc57628be1c8f0
|
|
7
|
+
data.tar.gz: 6fa421771cab463f19a275a982a137b5b928148499bd5fc45612660bc713d3d9bc524a22ea94e76e19947b5bdb4cdf5e5f40a1c51d176358d20c317ecdb103aa
|
data/CHANGES.md
ADDED
data/lib/might/paginator.rb
CHANGED
|
@@ -33,26 +33,7 @@ module Might
|
|
|
33
33
|
# @return [ActiveRecord::CollectionProxy]
|
|
34
34
|
#
|
|
35
35
|
def paginate(collection)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
pagination_hash = pagination(collection, paginated_collection)
|
|
39
|
-
|
|
40
|
-
paginated_collection.define_singleton_method(:pagination) do
|
|
41
|
-
pagination_hash
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
paginated_collection
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def pagination(collection, paginated_collection)
|
|
50
|
-
{
|
|
51
|
-
limit: limit,
|
|
52
|
-
offset: offset,
|
|
53
|
-
count: paginated_collection.count(:all),
|
|
54
|
-
total: collection.count(:all)
|
|
55
|
-
}
|
|
36
|
+
collection.offset(offset).limit(limit)
|
|
56
37
|
end
|
|
57
38
|
end
|
|
58
39
|
end
|
data/lib/might/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: might
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tema Bolshakov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-12-
|
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -176,6 +176,7 @@ files:
|
|
|
176
176
|
- ".rspec"
|
|
177
177
|
- ".rubocop.yml"
|
|
178
178
|
- ".travis.yml"
|
|
179
|
+
- CHANGES.md
|
|
179
180
|
- Gemfile
|
|
180
181
|
- LICENSE
|
|
181
182
|
- README.md
|
|
@@ -237,3 +238,4 @@ signing_key:
|
|
|
237
238
|
specification_version: 4
|
|
238
239
|
summary: Mighty resource fetchers
|
|
239
240
|
test_files: []
|
|
241
|
+
has_rdoc:
|