rails_dictionary 0.0.9.2 → 0.0.9.3
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.
@@ -28,6 +28,7 @@ module RailsDictionary
|
|
28
28
|
#
|
29
29
|
# Remove nil noise,if listed_attr =[[nil, 201], [nil, 203], [nil, 202], ["Sciences", 200]]
|
30
30
|
# the sort would be failed of ArgumentError: comparison of Array with Array failed
|
31
|
+
# split this method ,make it more short and maintainance
|
31
32
|
def method_missing(method_id,options={})
|
32
33
|
method_name=method_id.to_s.downcase
|
33
34
|
if DictType.all_types.include? method_id
|
@@ -37,7 +38,7 @@ module RailsDictionary
|
|
37
38
|
if options.keys.include? :locale or options.keys.include? "locale"
|
38
39
|
locale="name_#{ options[:locale] }"
|
39
40
|
listed_attr.map! { |a| [a.send(locale),a.id] }.reject! {|ele| ele.first.nil?}
|
40
|
-
listed_attr.sort { |a,b| a.first <=> b.first }
|
41
|
+
listed_attr.sort { |a,b| a.first.downcase <=> b.first.downcase }
|
41
42
|
# maybe remove the above line,or change some sorting and caching design
|
42
43
|
else
|
43
44
|
listed_attr
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rails_dictionary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.9.
|
5
|
+
version: 0.0.9.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Raykin Lee
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-18 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Rails plugin for mapping static data of web application to Dictionary class
|