rails-simple-search 1.0.1 → 1.0.2

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: 7b56d62f05d9444fa495c4a0bc9e505cb14c53e5
4
- data.tar.gz: 09f98933b79c66393bc6683f9325a731f4caece7
3
+ metadata.gz: 544d8e584f073bd4f57b9db0426f8a6dc41d6272
4
+ data.tar.gz: bc4bbd8caabca8932014b1dd2a7e932670210664
5
5
  SHA512:
6
- metadata.gz: 66ceaf08ebfa2bc4afc763dc3c30433490134b5dda5d35e494df55ae9641dfaeab0044f6ef4389f7242bd4d5e73be0211dca3b8e5951bbe39c16a64e752dc2e6
7
- data.tar.gz: bb162333f83d5f4320c533f830140009e8114ba900419dec473e37d0f7dd1287a40d501197e5dca941d91b9a891a19c6dbef3f7118b904ea8baed302873916ba
6
+ metadata.gz: df18323be0781c21ce3213d55d79435de56946e2efa7c5237dbe4f75ac108a8d90881d78701de558b82dfee9043ef33f1f592a7c572a6388091a3c2fa0ee2466
7
+ data.tar.gz: abffa445a4f31648637dca3816b6eee095ece3929f4407b3d1034512a2c55cfe400361a761626c8ee019d187073aea997ac7c99706a5fcbf25cd5edda1088630
@@ -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 mode_name
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
- value = column.cast_type.type_cast(value)
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.1
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-22 00:00:00.000000000 Z
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 get to quick build search function in rails
45
+ summary: A very simple and light gem to quickly build search/filter function in rails
46
46
  test_files: []