coded_options 0.1.7 → 0.1.8
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/README.md +9 -0
- data/lib/coded_options/base.rb +5 -1
- data/lib/coded_options/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -34,6 +34,15 @@ a plain Ruby object as follows:
|
|
34
34
|
foo.type_id = 1
|
35
35
|
foo.type #=> awesome
|
36
36
|
|
37
|
+
If the values are important to your application you can pass
|
38
|
+
a hash instead of an array like so:
|
39
|
+
|
40
|
+
coded_options :gender, {99 => 'other', 1 => 'male', 2 => 'female'}
|
41
|
+
|
42
|
+
GENDER will return a hash (the exact hash above), not an array. GENDER_OPTIONS
|
43
|
+
will return an array suitable for select tags. The array will be ordered
|
44
|
+
numerically by the keys of the hash.
|
45
|
+
|
37
46
|
If you want to use this with MongoDB, just add
|
38
47
|
|
39
48
|
extend CodedOptions
|
data/lib/coded_options/base.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coded_options
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason Dew
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-16 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|