classy_enum 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/classy_enum/active_record.rb +3 -1
- data/lib/classy_enum/base.rb +4 -2
- data/lib/classy_enum/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
data/lib/classy_enum/base.rb
CHANGED
@@ -25,8 +25,10 @@ module ClassyEnum
|
|
25
25
|
# This is due to a bug in Rails where it uses the method result as opposed to the
|
26
26
|
# database value for validation scopes. A fix will be released in Rails 4, but
|
27
27
|
# this will remain until Rails 3.x is no longer prevalent.
|
28
|
-
Arel::Visitors::ToSql
|
29
|
-
|
28
|
+
if defined?(Arel::Visitors::ToSql)
|
29
|
+
Arel::Visitors::ToSql.class_eval do
|
30
|
+
define_method "visit_#{klass.name.split('::').join('_')}", lambda {|value| quote(value.to_s) }
|
31
|
+
end
|
30
32
|
end
|
31
33
|
|
32
34
|
# Convert from MyEnumClass::NumberTwo to :number_two
|
data/lib/classy_enum/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: 4077796099842311388
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
segments:
|
135
135
|
- 0
|
136
|
-
hash:
|
136
|
+
hash: 4077796099842311388
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
139
|
rubygems_version: 1.8.24
|