spotlight_search 0.3.4 → 0.3.6

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
  SHA256:
3
- metadata.gz: bc7f95a4b32cda3a0fe9572388d9e73ef1bc8d6f539ea2ec63423a59ac051403
4
- data.tar.gz: 5f2873974e3fc88a2d8693d7dca287d3bb74af3c7538443d3188d78790d81e34
3
+ metadata.gz: fa62b0fa1fa56fc1ace4c5698acd5fbcac37d8cd895caeb4fdcbb399ff1095c6
4
+ data.tar.gz: fc1971734fe1a8bb28ba0f9dffaaac626c878ab182f3161041d1c4826260cc69
5
5
  SHA512:
6
- metadata.gz: 4063285378cd29f80b0c7a3f67e907bd1f8cf549613754aa54c6633eae2e9037509a3224c83d38128a5119a6627210e7ebd74da591b58e7f9aea253b169fa9db
7
- data.tar.gz: 85d4eae1e8ca517c454986bc383d57010b52971482b79e1e2285f651f534e57aad1685f8fe8418c8ca263d58897ac5b2fe2e6d4541fe1755a0413f61bfee729d
6
+ metadata.gz: de74c86292dfbbe18f45c13ea1d8964348ad2fa2fc3f2685e5b8161631da6879641ef40ad4948b86f4509aa14226722cfaedb0beae22549bdd9a3a9a9f1faf62
7
+ data.tar.gz: 8899bf1b1de3a1f2673e4305f988d9d17e681a5372d94ca3c004eac902a3cf5b4ff216474ac7d629a4bf07f9542412341097a43906e308ffd55539d6ece28241
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spotlight_search (0.1.9)
4
+ spotlight_search (0.3.6)
5
5
  caxlsx (~> 3.0.1)
6
6
 
7
7
  GEM
@@ -147,4 +147,4 @@ DEPENDENCIES
147
147
  spotlight_search!
148
148
 
149
149
  BUNDLED WITH
150
- 2.1.4
150
+ 2.5.9
@@ -156,14 +156,14 @@ module SpotlightSearch
156
156
  end
157
157
  end
158
158
  current_page = content_tag :li do
159
- tag.button class: 'cm-pagination__item', data: {sort_column: facets.sort[:sort_column], sort_direction: facets.sort[:sort_direction], page: facets.current_page, behaviour: 'current-page' } do
159
+ tag.button class: 'cm-pagination__item btn btn-bordered mx-2', data: {sort_column: facets.sort[:sort_column], sort_direction: facets.sort[:sort_direction], page: facets.current_page, behaviour: 'current-page' } do
160
160
  "Showing #{facets.current_page} of #{facets.total_pages} pages"
161
161
  end
162
162
  end
163
163
 
164
164
  if facets.next_page != false
165
165
  next_page = tag.li do
166
- tag.button class: 'cm-pagination__item', data: { behaviour: 'next-page'} do
166
+ tag.button class: 'cm-pagination__item btn btn-bordered mx-2', data: { behaviour: 'next-page'} do
167
167
  tag.span "Next"
168
168
  end
169
169
  end
@@ -1,3 +1,3 @@
1
1
  module SpotlightSearch
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -6,6 +6,8 @@ require 'spotlight_search/utils'
6
6
  require 'spotlight_search/railtie' if defined?(Rails)
7
7
  require 'active_support'
8
8
  require 'active_support/rails'
9
+ require 'ostruct'
10
+
9
11
 
10
12
  module SpotlightSearch
11
13
  extend ActiveSupport::Concern
@@ -21,7 +23,7 @@ module SpotlightSearch
21
23
 
22
24
  module ClassMethods
23
25
  def filter_by(page, filter_params = {}, sort_params = {})
24
- filtered_result = OpenStruct.new
26
+ filtered_result = ::OpenStruct.new
25
27
  sort_column = self.column_names.include?(sort_params[:sort_column]) ? sort_params[:sort_column] : "#{self.table_name}.created_at"
26
28
  sort_direction = %w[asc desc].include?(sort_params[:sort_direction]) ? sort_params[:sort_direction] : "asc"
27
29
  sort_params = {sort_column: sort_column, sort_direction: sort_direction}
@@ -53,7 +55,7 @@ module SpotlightSearch
53
55
  def paginate(page, total_count)
54
56
  page = page.presence || 1
55
57
  per_page = 30
56
- facets = OpenStruct.new # initializing OpenStruct instance
58
+ facets = ::OpenStruct.new # initializing OpenStruct instance
57
59
  facets.total_count = total_count
58
60
  facets.filtered_count = total_count
59
61
  facets.total_pages = (total_count/per_page.to_f).ceil
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spotlight_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anbazhagan Palani
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-05-29 00:00:00.000000000 Z
@@ -132,7 +132,7 @@ homepage: https://github.com/commutatus/spotlight-search
132
132
  licenses:
133
133
  - MIT
134
134
  metadata: {}
135
- post_install_message:
135
+ post_install_message:
136
136
  rdoc_options: []
137
137
  require_paths:
138
138
  - lib
@@ -147,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.0.3
151
- signing_key:
150
+ rubygems_version: 3.5.9
151
+ signing_key:
152
152
  specification_version: 4
153
153
  summary: This gem should help reduce the efforts in the admin panel. It has search,
154
154
  sort and pagination included.