simpleadmin 1.0.2 → 1.0.3

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: 8201bf0dbc5df807ea21d1d89974b94e2d0df12c
4
- data.tar.gz: 5033ce97bfb6d19d7638c871d53027554755355c
3
+ metadata.gz: 5475a7e55a4a8672e7524500c27e92399dab2440
4
+ data.tar.gz: 168b7ac2be2630a294ca30cd5cf32922ccd554a8
5
5
  SHA512:
6
- metadata.gz: 8f5048350297f80562613332d87fd4c1617954d4ca374d52c81932b8a84635c067eb4541d6c2a1a9984e8ddf3a6ac2520ceaa8b68114c461b6ccb1e8e7cdd4cd
7
- data.tar.gz: f1afb2e64728546973b50d2b483c0832fb7195bd188c6c8c3c8dc32057eb106648c8b6c4695beeef412fadfff805d07952ce4a0a1835856a718a6f7e4b8aa196
6
+ metadata.gz: ed8202a0810a0bf7957d4abda2a3cb63b76a5725dca2124ce9f1919eb8eecc31d86b737e4496ef3c7d5fd809c293fbfffdafe88cef5b04bc892309d613478f8e
7
+ data.tar.gz: 5b7e63c249a5ed08c29e66af599cbcee9de17e71a8c49eade317f6def70aa964c0856bbb9b90da72a18fe1aa5de25ddc4902c2400c514e846ad333ec03c19f6c
@@ -8,7 +8,7 @@ module SimpleAdmin
8
8
  page = params[:page].to_i if params[:page].present?
9
9
  total = model_klass.count
10
10
 
11
- resources = model_klass.order(id: :asc).limit(per_page)
11
+ resources = model_klass.limit(per_page)
12
12
 
13
13
  if params[:query].present?
14
14
  search_result = search(params[:query], model_klass, params[:model_attributes])
@@ -18,7 +18,12 @@ module SimpleAdmin
18
18
  end
19
19
 
20
20
  resources = resources.offset((per_page * page) - per_page) if page.present?
21
- resources = resources.order(params[:sort][:column_name] => params[:sort][:order]) if params[:sort].present?
21
+
22
+ if params[:sort].present?
23
+ resources = resources.order(params[:sort][:column_name] => params[:sort][:order])
24
+ else
25
+ resources = resources.order(id: :asc)
26
+ end
22
27
 
23
28
  resources = resources.map do |resource|
24
29
  _resource = {}
@@ -1,3 +1,3 @@
1
1
  module Simpleadmin
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpleadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Strukov