simple_column_search 1.0.3 → 1.0.4
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.
- data/CHANGELOG +2 -0
- data/lib/simple_column_search.rb +5 -1
- data/simple_column_search.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
data/lib/simple_column_search.rb
CHANGED
@@ -21,6 +21,9 @@ module SimpleColumnSearch
|
|
21
21
|
options[:match] ||= :start
|
22
22
|
options[:name] ||= 'search'
|
23
23
|
|
24
|
+
# Test options at create time
|
25
|
+
get_simple_column_pattern(options[:match], 'test')
|
26
|
+
|
24
27
|
# PostgreSQL LIKE is case-sensitive, use ILIKE for case-insensitive
|
25
28
|
like = connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
|
26
29
|
# Determine if ActiveRecord 3 or ActiveRecord 2.3 - probaly beter way to do it!
|
@@ -54,10 +57,11 @@ module SimpleColumnSearch
|
|
54
57
|
when :end
|
55
58
|
'%' + term
|
56
59
|
else
|
57
|
-
raise "Unexpected match type: #{
|
60
|
+
raise InvalidMatcher, "Unexpected match type: #{match}"
|
58
61
|
end
|
59
62
|
end
|
60
63
|
|
64
|
+
class InvalidMatcher < StandardError; end
|
61
65
|
|
62
66
|
end
|
63
67
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{simple_column_search}
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Elijah Miller"]
|
9
|
-
s.date = %q{2010-09-
|
9
|
+
s.date = %q{2010-09-21}
|
10
10
|
s.description = %q{Quick and dirty multi column LIKE searches.}
|
11
11
|
s.email = %q{elijah.miller@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/simple_column_search.rb", "README.rdoc"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_column_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Elijah Miller
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-21 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|