mcommons-enum_for 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/enum_for.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{enum_for}
3
- s.version = "0.0.4"
3
+ s.version = "0.0.5"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Mal McKay and Justin Leitgeb"]
data/lib/enum_for.rb CHANGED
@@ -14,7 +14,7 @@ module EnumFor
14
14
  # to +enum_for+.
15
15
  def enum_for(*args)
16
16
  options = args.extract_options!
17
- additives = options[:add].respond_to?(:each) ? options[:add] : ( options[:add].nil? ? [ ] : [ options[:add] ] )
17
+ additives = options[:add].respond_to?(:include?) ? options[:add] : ( options[:add].nil? ? [ ] : [ options[:add] ] )
18
18
  attribute = args.first
19
19
 
20
20
  plural_attribute = attribute.to_s.pluralize
@@ -24,7 +24,6 @@ module EnumFor
24
24
  all_valid_values = options[:has].map{|v| v.to_s} | options[:has].map{|v| v.to_sym}
25
25
 
26
26
  validates_inclusion_of attribute, options.except(:has, :prefix, :add).merge(:in => all_valid_values )
27
- const_set(plural_attribute.upcase, options[:has])
28
27
 
29
28
  prefix = options.has_key?(:prefix) ? options[:prefix] : attribute.to_s
30
29
 
@@ -51,10 +51,6 @@ describe EnumFor do
51
51
  end
52
52
 
53
53
  describe "storage and retrieval of possible states in class" do
54
- it "should return all possible states when plural of the attribute is called as constant" do
55
- Taco::STATES.should == [ :new, :composed, :served, :eaten ]
56
- end
57
-
58
54
  it "should return all possible states when plural of attribute is called as class method" do
59
55
  Taco.states.should == [ :new, :composed, :served, :eaten ]
60
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcommons-enum_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mal McKay and Justin Leitgeb