has_enum 0.7.2 → 0.7.2.1

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.
@@ -12,4 +12,8 @@ class ActiveRecord::Base
12
12
  include HasEnum
13
13
  end
14
14
 
15
- require 'has_enum/formtastic'
15
+ begin
16
+ require 'formtastic'
17
+ require 'has_enum/formtastic'
18
+ rescue LoadError
19
+ end
@@ -1,24 +1,20 @@
1
- begin
2
- require 'formtastic'
1
+ Formtastic::SemanticFormBuilder.class_eval do
3
2
 
4
- Formtastic::SemanticFormBuilder.class_eval do
5
-
6
- def enum_input(method, options = {})
7
- options.merge! :collection => object.class.values_for_select_tag(method),
8
- :wrapper_html => {:class => :enum}
9
- self.select_input(method, options)
10
- end
3
+ def enum_input(method, options = {})
4
+ options.merge! :collection => object.class.values_for_select_tag(method),
5
+ :wrapper_html => {:class => :enum}
6
+ select_input method, options
7
+ end
11
8
 
12
- def default_input_type_with_enum(method, options={})
13
- if object.class.respond_to?(:enums) && object.class.has_enum?(method)
14
- :enum
15
- else
16
- default_input_type_without_enum(method, options)
17
- end
9
+ def default_input_type_with_enum(method, options={})
10
+ if object.class.respond_to?(:enums) && object.class.has_enum?(method)
11
+ :enum
12
+ else
13
+ default_input_type_without_enum(method, options)
18
14
  end
15
+ end
19
16
 
20
- alias_method_chain :default_input_type, :enum
17
+ alias_method_chain :default_input_type, :enum
21
18
 
22
- end
23
- rescue LoadError
24
19
  end
20
+
@@ -1,3 +1,3 @@
1
1
  module HasEnum
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.2.1"
3
3
  end
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 7
8
8
  - 2
9
- version: 0.7.2
9
+ - 1
10
+ version: 0.7.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Andreas Korth