models_auditor 1.2.0 → 1.2.1

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: 99a387e69efd7a90352cdf2ef193a8ac885d2f58
4
- data.tar.gz: d45f0de4510f98035c96635760bb5a654621b874
3
+ metadata.gz: 1379f47b3175d0e092a3fe67e5a3d344219b9515
4
+ data.tar.gz: b18b8a5be1eb4f5b355213c3e37d7c808b5cfbf1
5
5
  SHA512:
6
- metadata.gz: 0d501e1c682daae07a70054ab5b23638a00ea71f6dd7c1b05ce7a9af4eaa9f17386b140bc88f5689bfb5b1df214f211c0b84ed60665790ee059a59c97835bf2b
7
- data.tar.gz: 48c6ab3335b1b4325a10ffca829b6338cbed273e33410d2da85d22d133a1532e223c5879555ced53e6f5d2d62c973ffd698038e38110ca9ec65c19da41d11354
6
+ metadata.gz: 20a11e72fe62e25dbb3f4b38ce3e0326512cbb528f19db7d4b9c1b697074fa2427dc5a21fd16285029a7de6c3e364ed416d51af7365411b924016981346a6a49
7
+ data.tar.gz: 7f9339b9c77ea9c1cc600cc1aa7bcd7167b0b48dd2f28e0708f6434c54be7c2e54fea946fa71eb1aeef7276e9bd53e5570ed7d680f4ec392c50512c3e5303df2
@@ -25,9 +25,9 @@ module ModelsAuditor
25
25
  render json: {
26
26
  ModelsAuditor.config.json_response_data_key => formatter.as_json,
27
27
  ModelsAuditor.config.json_response_meta_key => {
28
- per_page: @collection.per_page,
29
- total: @collection.total_entries,
30
- sort_by: @collection.order_info
28
+ per_page: paginate_info[:per_page] || @collection.per_page,
29
+ total: paginate_info[:total_entries] || @collection.total_entries,
30
+ sort_by: @collection.order_info
31
31
  }
32
32
  }
33
33
  }
@@ -76,7 +76,9 @@ module ModelsAuditor
76
76
  end
77
77
 
78
78
  filtered_requests = collection.pluck(:id)
79
- original.where(id: filtered_requests)
79
+ original
80
+ .paginate(page: 1, per_page: original.per_page, total_entries: original.total_entries)
81
+ .where(id: filtered_requests)
80
82
  end
81
83
 
82
84
  end
@@ -1,3 +1,3 @@
1
1
  module ModelsAuditor
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: models_auditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Gorbunov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails