snaptable 2.1.0 → 2.2.0
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a22442e1f0816b6884b6241596b11cd1d1280b98
|
|
4
|
+
data.tar.gz: e6bc598de7d2d5319fe02463382b86f73afd9faf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d9403fdf46902ba310d79f5fb908ad0c4b3d626e3722a6707f90c06a99a65715dc46814eea2897b5a34f700cab49d69239a3384ddf8f6a31869f9d8ec82dfbf
|
|
7
|
+
data.tar.gz: 892246813211c0a9afaf0f25c5505ae499a2aad8dc42dea6ed815d26f564d7b43a320254a7330d8e56444b2b8c3322b4e4ad628df79ca07827fc81707a16640d
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<p><%= t("table.search.title") %></p>
|
|
3
3
|
<%= form_tag nil, method: :get, remote: true do %>
|
|
4
4
|
<%= hidden_field_tag :table, presenter.table_name %>
|
|
5
|
+
<%= hidden_field_tag :buttons, presenter.instance_variable_get(:@buttons) %>
|
|
5
6
|
<%= search_field_tag :query, params[:query] %>
|
|
6
7
|
<%= submit_tag t("table.search.submit") %>
|
|
7
8
|
<% end %>
|
|
@@ -12,7 +12,7 @@ module Snaptable
|
|
|
12
12
|
|
|
13
13
|
def filter(collection)
|
|
14
14
|
if options[:search] == true && !params[:query].blank?
|
|
15
|
-
collection.joins(search_associations).where(query, query: "%#{params[:query]}%", id: params[:query].to_i)
|
|
15
|
+
collection.joins(search_associations).where(query, query: "%#{params[:query].downcase}%", id: params[:query].to_i)
|
|
16
16
|
else
|
|
17
17
|
collection
|
|
18
18
|
end
|
|
@@ -23,7 +23,7 @@ module Snaptable
|
|
|
23
23
|
def query
|
|
24
24
|
query_fields.map do |key, values|
|
|
25
25
|
values.map do |value|
|
|
26
|
-
"#{key}.#{value} LIKE :query OR"
|
|
26
|
+
"LOWER(#{key}.#{value}) LIKE :query OR"
|
|
27
27
|
end.join(" ")
|
|
28
28
|
end.join(" ") + " #{column_name('id')} = :id"
|
|
29
29
|
end
|
|
@@ -11,7 +11,7 @@ module Snaptable
|
|
|
11
11
|
respond_to do |format|
|
|
12
12
|
format.html
|
|
13
13
|
format.js do
|
|
14
|
-
render '/snaptable/sort', locals: { content: self.present(buttons:
|
|
14
|
+
render '/snaptable/sort', locals: { content: self.present(buttons: params[:buttons]) }
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -4,7 +4,7 @@ module Snaptable
|
|
|
4
4
|
|
|
5
5
|
def sortable(column)
|
|
6
6
|
if model.reflect_on_association(column.gsub /_id/, '').nil?
|
|
7
|
-
view_context.link_to({sort: column, direction: direction(column), query: params[:query], paginate_key => page, table: table_name}, {remote: true, class: css_class(column)}) do
|
|
7
|
+
view_context.link_to({sort: column, direction: direction(column), query: params[:query], paginate_key => page, table: table_name, buttons: @buttons}, {remote: true, class: css_class(column)}) do
|
|
8
8
|
model.human_attribute_name(column)
|
|
9
9
|
end
|
|
10
10
|
else
|
data/lib/snaptable/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snaptable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- khcr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-04
|
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|