bolter 0.3.0 → 0.3.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: 52578fcf1c9bc72f05c801f76bc2ca6ac39f4770
4
- data.tar.gz: fb776fdcc9b125db0b42977011a24df11d7b6d1e
3
+ metadata.gz: a6e7447428e048162fffb71c8feb92c6d537e40c
4
+ data.tar.gz: 008034a83b59cf18a0a8be75f9e7c6209da7734d
5
5
  SHA512:
6
- metadata.gz: 3f62de8aa336b4298e03738330dcae5b52ea0635ead54d1e59d4c88c22de9423c6f598e4bd02c6469457a88a20d8952971095d559258c0fbf31a154daaf1272c
7
- data.tar.gz: 929f9fa946426da756cd52f78b827ae2ad9645ac8a5d5df62e8f77da83ee727b283fe2bc443f3eb0384e5d99b48cab5ba083c99648585a386ed5cad617c3ef91
6
+ metadata.gz: 2134b161ad6dac22e4bbcb487facd68fa9e0d9994a55f3e83fa7cdede4e1c7651a402d16bfdcfe4a825aace466881f2722ec7b4f8aeb8aab136d3c1671c9a66a
7
+ data.tar.gz: a300c1ff681d3c221c2ec2092e8ea10ad360e5448c3224d0cda6e5ae5eaa385d59474fd0ec9f93d571d3ab4e66503751de9d59196d2edd247c59e1dc06caec25
@@ -3,14 +3,14 @@ module Bolter
3
3
  extend ActiveSupport::Concern
4
4
  included do
5
5
  def self.sorting(sorting = nil)
6
- return self unless sorting
6
+ return self.order({}) unless sorting
7
7
  field, direction = sorting.split(':',2)
8
8
  if self.attribute_names.include? field.to_s
9
9
  if %W[asc desc].include? direction
10
- return self.order(Hash[field, direction])
10
+ return self.reorder(Hash[field, direction])
11
11
  end
12
12
  else
13
- self
13
+ self.order({})
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Bolter
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Shurmin