bolter 0.3.4 → 0.3.5

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: 194215c42aa774f391f249469fed2f50f9381840
4
- data.tar.gz: 781bbec1af8bac0b4f8a5732c93d1cb729717cda
3
+ metadata.gz: 43fa0d127dc6b6e16cda2a3e22db976da485a68b
4
+ data.tar.gz: 42f9c4a24ee34baa223556a24067985ea09f2dc8
5
5
  SHA512:
6
- metadata.gz: ab16c0ef7dc096c775280ed054a660b1dae74887987bd674ab34f39a3e034e084d4bbb0641fda984ee2d5e9179bbce7d4ff255dfe12d65e7cb3f57ccd58c4d59
7
- data.tar.gz: 003f49f8e68ddf4693cee5fd249e5f2778dd7039556e588b3fc86b9d3d5728e92e5013fc8ee1e21fafc880be8497657a7866913f62d91d06f7f92585000a6d92
6
+ metadata.gz: eae0e0cce04ea02fafee80ba751ea6c687edeaf87e5ada3b6a4bfe61e6d8ddf179586e4ac1d37d0b51032ef17dea73abff9dc460f3d8aa45c421c5228b099d56
7
+ data.tar.gz: 073d3e314f83566298c86226ec56a8e85022385da20abff1fdecc82b8221e6d1642a7b0c15e10ef64bbb01a7dc00bd1f48ebe58028a75aae8128da236849ed95
@@ -4,7 +4,7 @@ module Bolter
4
4
  included do
5
5
  cattr_reader :used_as_filters
6
6
  def self.search(params = {}, options = {})
7
- result = self.current_scope
7
+ result = self.current_scope || self
8
8
  # Prepare params to search
9
9
  search = (params || {}).clone.reject{|_,value| value.to_s.empty? }
10
10
  # Apply filters
@@ -7,7 +7,7 @@ module Bolter
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.current_scope.reorder(Hash[field, direction])
10
+ return (self.current_scope || self).reorder(Hash[field, direction])
11
11
  end
12
12
  else
13
13
  self.order({})
@@ -1,3 +1,3 @@
1
1
  module Bolter
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
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.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Shurmin