ar-enums 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
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.1"
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-04-15}
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 = [
@@ -19,7 +19,11 @@ module ActiveRecord
19
19
 
20
20
  private
21
21
  def asume_external_style field
22
- lambda { |options| field.external_class(options).all }
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
@@ -17,11 +17,7 @@ module ActiveRecord
17
17
 
18
18
  def foreign_key
19
19
  "#{name}_id"
20
- end
21
-
22
- def external_class options = {}
23
- (options.delete(:class_name) || name).camelize.constantize
24
- end
20
+ end
25
21
  end
26
22
  end
27
23
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
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-04-15 00:00:00 -03:00
17
+ date: 2010-08-09 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency