JasonKing-sqlite_nocase 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +28 -0
- data/lib/sqlite_nocase.rb +11 -0
- metadata +64 -0
data/README.markdown
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
SQLite Nocase
|
2
|
+
=================
|
3
|
+
|
4
|
+
This is a kludgy kludge until I get the time to work on a full and proper patch
|
5
|
+
to the core for an actual column option. With this lib loaded ALL string and
|
6
|
+
text fields will be created with the NOCASE collation in SQLite.
|
7
|
+
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
|
11
|
+
To perform a system wide installation:
|
12
|
+
|
13
|
+
gem source -a http://gems.github.com
|
14
|
+
sudo gem install JasonKing-sqlite_nocase
|
15
|
+
|
16
|
+
To use sqlite_nocase in your project, add the following line to your project's
|
17
|
+
config/environment.rb:
|
18
|
+
|
19
|
+
config.gem 'JasonKing-sqlite_nocase', :lib => 'sqlite_nocase'
|
20
|
+
|
21
|
+
Once it's loaded, ALL migrations from that point on will add the NOCASE
|
22
|
+
collation for all table operations (CREATE and ALTER) on all string (varchar)
|
23
|
+
and text columns.
|
24
|
+
|
25
|
+
Contributors
|
26
|
+
------------
|
27
|
+
|
28
|
+
* Jason King (JasonKing)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SQLite
|
2
|
+
module Nocase
|
3
|
+
def add_column_options!(sql, options, type = :nothing) #:nodoc:
|
4
|
+
super( sql, options )
|
5
|
+
if sql =~ /varchar/ || sql =~ /text/
|
6
|
+
sql << " COLLATE NOCASE"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
ActiveRecord::ConnectionAdapters::SQLiteAdapter.send( :include, SQLite::Nocase)
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: JasonKing-sqlite_nocase
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jason King
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-25 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sqlite3-ruby
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "1.0"
|
24
|
+
version:
|
25
|
+
description:
|
26
|
+
email: jk@handle.it
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- README.markdown
|
35
|
+
- lib/sqlite_nocase.rb
|
36
|
+
has_rdoc: true
|
37
|
+
homepage: http://github.com/JasonKing/sqlite_nocase
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options:
|
40
|
+
- --inline-source
|
41
|
+
- --charset=UTF-8
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: "0"
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.2.0
|
60
|
+
signing_key:
|
61
|
+
specification_version: 2
|
62
|
+
summary: Makes SQLite create case-insensitive string and text fields
|
63
|
+
test_files: []
|
64
|
+
|