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.
@@ -8,6 +8,10 @@ module HasEnum::ClassMethods
8
8
  enums[attribute]
9
9
  end
10
10
 
11
+ def has_enum?(enum)
12
+ enums.include? enum
13
+ end
14
+
11
15
  def has_enum(*params)
12
16
  options = params.extract_options!
13
17
  options.assert_valid_keys(:query_methods, :scopes, :presence)
@@ -1,3 +1,3 @@
1
1
  module HasEnum
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -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
- version: 0.7.0
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-24 00:00:00 +06:00
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.6.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