has_enum 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/has_enum/class_methods.rb +4 -0
- data/lib/has_enum/version.rb +1 -1
- data/spec/has_enum_spec.rb +5 -0
- metadata +23 -4
data/lib/has_enum/version.rb
CHANGED
data/spec/has_enum_spec.rb
CHANGED
@@ -37,6 +37,11 @@ describe HasEnum do
|
|
37
37
|
}.with_indifferent_access
|
38
38
|
end
|
39
39
|
|
40
|
+
it "should have has_enum? method" do
|
41
|
+
TestModel.should be_has_enum(:state)
|
42
|
+
TestModel.should_not be_has_enum(:some_attribute)
|
43
|
+
end
|
44
|
+
|
40
45
|
it "should return values by name symbol" do
|
41
46
|
TestModel.enums[:state].should eql human_enums[:state].stringify_keys.keys
|
42
47
|
end
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 7
|
8
|
+
- 1
|
9
|
+
version: 0.7.1
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Andreas Korth
|
@@ -12,7 +16,7 @@ autorequire:
|
|
12
16
|
bindir: bin
|
13
17
|
cert_chain: []
|
14
18
|
|
15
|
-
date: 2011-03-
|
19
|
+
date: 2011-03-28 00:00:00 +07:00
|
16
20
|
default_executable:
|
17
21
|
dependencies:
|
18
22
|
- !ruby/object:Gem::Dependency
|
@@ -23,6 +27,10 @@ dependencies:
|
|
23
27
|
requirements:
|
24
28
|
- - ~>
|
25
29
|
- !ruby/object:Gem::Version
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
26
34
|
version: 3.0.0
|
27
35
|
type: :runtime
|
28
36
|
version_requirements: *id001
|
@@ -34,6 +42,9 @@ dependencies:
|
|
34
42
|
requirements:
|
35
43
|
- - ~>
|
36
44
|
- !ruby/object:Gem::Version
|
45
|
+
segments:
|
46
|
+
- 2
|
47
|
+
- 5
|
37
48
|
version: "2.5"
|
38
49
|
type: :development
|
39
50
|
version_requirements: *id002
|
@@ -45,6 +56,10 @@ dependencies:
|
|
45
56
|
requirements:
|
46
57
|
- - ~>
|
47
58
|
- !ruby/object:Gem::Version
|
59
|
+
segments:
|
60
|
+
- 1
|
61
|
+
- 3
|
62
|
+
- 3
|
48
63
|
version: 1.3.3
|
49
64
|
type: :development
|
50
65
|
version_requirements: *id003
|
@@ -90,17 +105,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
105
|
requirements:
|
91
106
|
- - ">="
|
92
107
|
- !ruby/object:Gem::Version
|
108
|
+
segments:
|
109
|
+
- 0
|
93
110
|
version: "0"
|
94
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
112
|
none: false
|
96
113
|
requirements:
|
97
114
|
- - ">="
|
98
115
|
- !ruby/object:Gem::Version
|
116
|
+
segments:
|
117
|
+
- 0
|
99
118
|
version: "0"
|
100
119
|
requirements: []
|
101
120
|
|
102
121
|
rubyforge_project:
|
103
|
-
rubygems_version: 1.
|
122
|
+
rubygems_version: 1.3.7
|
104
123
|
signing_key:
|
105
124
|
specification_version: 3
|
106
125
|
summary: Gem for Rails to easily handle enumeration attributes in models
|