rails-simple-search 1.0.1 → 1.0.2
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 +4 -4
- data/lib/rails-simple-search.rb +1 -1
- data/lib/sql_handler.rb +7 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 544d8e584f073bd4f57b9db0426f8a6dc41d6272
|
|
4
|
+
data.tar.gz: bc4bbd8caabca8932014b1dd2a7e932670210664
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df18323be0781c21ce3213d55d79435de56946e2efa7c5237dbe4f75ac108a8d90881d78701de558b82dfee9043ef33f1f592a7c572a6388091a3c2fa0ee2466
|
|
7
|
+
data.tar.gz: abffa445a4f31648637dca3816b6eee095ece3929f4407b3d1034512a2c55cfe400361a761626c8ee019d187073aea997ac7c99706a5fcbf25cd5edda1088630
|
data/lib/rails-simple-search.rb
CHANGED
|
@@ -18,7 +18,7 @@ module RailsSimpleSearch
|
|
|
18
18
|
class Base
|
|
19
19
|
def self.inherited(subclass)
|
|
20
20
|
class << subclass
|
|
21
|
-
# in rails 3, the call to "form_for" invokes the
|
|
21
|
+
# in rails 3, the call to "form_for" invokes the model_name
|
|
22
22
|
def model_name
|
|
23
23
|
ActiveModel::Name.new(self)
|
|
24
24
|
end
|
data/lib/sql_handler.rb
CHANGED
|
@@ -79,7 +79,13 @@ module RailsSimpleSearch
|
|
|
79
79
|
if column.respond_to?(:type_cast)
|
|
80
80
|
value = column.type_cast(value)
|
|
81
81
|
elsif column.respond_to?(:cast_type)
|
|
82
|
-
|
|
82
|
+
if column.cast_type.respond_to?(:type_cast)
|
|
83
|
+
value = column.cast_type.type_cast(value)
|
|
84
|
+
elsif column.cast_type.respond_to?(:type_cast_from_user)
|
|
85
|
+
value = column.cast_type.type_cast_from_user(value)
|
|
86
|
+
else
|
|
87
|
+
raise "something wrong!"
|
|
88
|
+
end
|
|
83
89
|
else
|
|
84
90
|
raise "something wrong!"
|
|
85
91
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-simple-search
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yi Zhang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: rails-simple-search is a light and easy to use gem. It could help developers
|
|
14
14
|
quickly build a search page.
|
|
@@ -42,5 +42,5 @@ rubyforge_project:
|
|
|
42
42
|
rubygems_version: 2.4.5
|
|
43
43
|
signing_key:
|
|
44
44
|
specification_version: 4
|
|
45
|
-
summary: A very simple and light
|
|
45
|
+
summary: A very simple and light gem to quickly build search/filter function in rails
|
|
46
46
|
test_files: []
|