Class: Bureaucrat::Fields::ComboField
- Defined in:
- lib/bureaucrat/fields.rb
Overview
TODO: tests
Instance Attribute Summary
Attributes inherited from Field
#error_messages, #help_text, #hidden_widget, #initial, #label, #required, #show_hidden_initial, #validators, #widget
Instance Method Summary collapse
- #clean(value) ⇒ Object
-
#initialize(fields = [], *args) ⇒ ComboField
constructor
A new instance of ComboField.
Methods inherited from Field
#bound_data, #default_error_messages, #default_hidden_widget, #default_validators, #default_widget, #initialize_copy, #populate_object, #prepare_value, #run_validators, #to_object, #validate, #widget_attrs
Constructor Details
#initialize(fields = [], *args) ⇒ ComboField
Returns a new instance of ComboField.
660 661 662 663 664 |
# File 'lib/bureaucrat/fields.rb', line 660 def initialize(fields=[], *args) super(*args) fields.each {|f| f.required = false} @fields = fields end |
Instance Method Details
#clean(value) ⇒ Object
666 667 668 669 670 |
# File 'lib/bureaucrat/fields.rb', line 666 def clean(value) super(value) @fields.each {|f| value = f.clean(value)} value end |