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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8ad5a2a1fad44b7b91dd8179dcc3befa9b77a92
4
- data.tar.gz: 7b56ff9fef68c379480c70d779c53a3033b9d34a
3
+ metadata.gz: ae3926df5c33265477c17c0e4a6fdf51bbce9be3
4
+ data.tar.gz: c83a4f1777d278ff57c90413eb83f4594e48ff4c
5
5
  SHA512:
6
- metadata.gz: f0133660039a13166f4a32a0c87c3496facb8df76c527869c4773a54724a4c6559c1c94feaa18a4a1dab8bddebc4322350955a393845fc84f6998bf009b098b0
7
- data.tar.gz: fd1b270755e6966c8cbb447ec90959ce6b6415b4fef2dbbe5c29f96eb8c4762bb282a0f20ee3c582a59a2d34ca9153090709ad1fefe65560db291b49da474b41
6
+ metadata.gz: dc69eca7bb795d151954266c0983c524ad8be4d91402bd6a51632073dfea34b0d82be496870e114c3344149dbab105118ed8f68aab72dadc34dc57628be1c8f0
7
+ data.tar.gz: 6fa421771cab463f19a275a982a137b5b928148499bd5fc45612660bc713d3d9bc524a22ea94e76e19947b5bdb4cdf5e5f40a1c51d176358d20c317ecdb103aa
data/CHANGES.md ADDED
@@ -0,0 +1,3 @@
1
+ **0.4.0**
2
+
3
+ * Got rid off `#pagination` method on paginated collection.
@@ -33,26 +33,7 @@ module Might
33
33
  # @return [ActiveRecord::CollectionProxy]
34
34
  #
35
35
  def paginate(collection)
36
- paginated_collection = collection.offset(offset).limit(limit)
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
@@ -1,4 +1,4 @@
1
1
  #
2
2
  module Might
3
- VERSION = '0.3.1'
3
+ VERSION = '0.4.0'
4
4
  end
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.3.1
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-10 00:00:00.000000000 Z
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: