symbolize 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/symbolize.rb +4 -2
  3. data/symbolize.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.1
data/lib/symbolize.rb CHANGED
@@ -55,6 +55,7 @@ module Symbolize
55
55
  i18n = configuration.delete(:i18n).nil? && !enum.instance_of?(Hash) && enum ? true : configuration[:i18n]
56
56
  scopes = configuration.delete :scopes
57
57
  methods = configuration.delete :methods
58
+ capitalize = configuration.delete :capitalize
58
59
  validation = configuration.delete(:validation) != false
59
60
  default_option = configuration.delete :default
60
61
 
@@ -69,7 +70,7 @@ module Symbolize
69
70
  values = enum
70
71
  else
71
72
  values = hsh.new
72
- enum.map { |v| [v, (configuration[:capitalize] ? v.to_s.capitalize : v.to_s)] }.each { |k, v| values[k] = v }
73
+ enum.map { |v| [v, (capitalize ? v.to_s.capitalize : v.to_s)] }.each { |k, v| values[k] = v }
73
74
  end
74
75
 
75
76
  # Get the values of :in
@@ -110,7 +111,8 @@ module Symbolize
110
111
  end
111
112
 
112
113
  if validation
113
- class_eval "validates_inclusion_of :#{attr_names.join(', :')}, #{configuration}"
114
+ p "validates_inclusion_of :#{attr_names.join(', :')}, #{configuration.inspect}"
115
+ class_eval "validates_inclusion_of :#{attr_names.join(', :')}, #{configuration.inspect}"
114
116
  end
115
117
  end
116
118
 
data/symbolize.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{symbolize}
8
- s.version = "3.1.0"
8
+ s.version = "3.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcos Piccinini"]
12
- s.date = %q{2011-03-23}
12
+ s.date = %q{2011-03-25}
13
13
  s.description = %q{ActiveRecord enums with i18n}
14
14
  s.email = %q{x@nofxx.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: symbolize
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.1.0
5
+ version: 3.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marcos Piccinini
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-23 00:00:00 -03:00
13
+ date: 2011-03-25 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency