kyanite 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kyanite/string/cast.rb +21 -0
- data/lib/kyanite/string/chars_const.rb +0 -3
- data/version.rb +1 -1
- metadata +1 -1
data/lib/kyanite/string/cast.rb
CHANGED
@@ -114,6 +114,27 @@ class String
|
|
114
114
|
str
|
115
115
|
end
|
116
116
|
|
117
|
+
|
118
|
+
unless defined? MYSQL_REPLACES
|
119
|
+
MYSQL_REPLACES = [
|
120
|
+
[/ä/, 'a'],
|
121
|
+
[/ö/, 'o'],
|
122
|
+
[/ü/, 'u'],
|
123
|
+
[/Ä/, 'a'],
|
124
|
+
[/Ö/, 'o'],
|
125
|
+
[/Ü/, 'u'],
|
126
|
+
[/ss/, 'ß'],
|
127
|
+
[/SS/, 'ß']
|
128
|
+
]
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
# Converts a string so that you can recognize with utf8_general_ci compared strings
|
133
|
+
#
|
134
|
+
def mysqlize
|
135
|
+
self.tidy_bytes.mgsub(MYSQL_REPLACES).downcase.to_s
|
136
|
+
end
|
137
|
+
|
117
138
|
|
118
139
|
end
|
119
140
|
|
data/version.rb
CHANGED