ar-enums 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ar-enums.gemspec +2 -2
- data/lib/enum_definition.rb +5 -1
- data/lib/enum_field.rb +1 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/ar-enums.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ar-enums}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Emmanuel Nicolau"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-09}
|
13
13
|
s.description = %q{Provides a simple way for defining enumerations in ActiveRecord models}
|
14
14
|
s.email = %q{emmanicolau@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/enum_definition.rb
CHANGED
@@ -19,7 +19,11 @@ module ActiveRecord
|
|
19
19
|
|
20
20
|
private
|
21
21
|
def asume_external_style field
|
22
|
-
lambda { |options|
|
22
|
+
lambda { |options| external_class(field, options).all }
|
23
|
+
end
|
24
|
+
|
25
|
+
def external_class field, options = {}
|
26
|
+
compute_type options.delete(:class_name) || field.name.camelize
|
23
27
|
end
|
24
28
|
|
25
29
|
def define_enums_getter field, enums
|
data/lib/enum_field.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 2
|
9
|
+
version: 0.3.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Emmanuel Nicolau
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-08-09 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|