2010-01-09 15:05:02 +00:00
|
|
|
module SimpleForm
|
|
|
|
module Inputs
|
2012-01-26 19:00:56 +00:00
|
|
|
class PriorityInput < CollectionSelectInput
|
2010-01-09 15:05:02 +00:00
|
|
|
def input
|
|
|
|
@builder.send(:"#{input_type}_select", attribute_name, input_priority,
|
|
|
|
input_options, input_html_options)
|
|
|
|
end
|
|
|
|
|
|
|
|
def input_priority
|
|
|
|
options[:priority] || SimpleForm.send(:"#{input_type}_priority")
|
|
|
|
end
|
2010-02-03 14:56:27 +00:00
|
|
|
|
2012-01-26 19:22:05 +00:00
|
|
|
protected
|
2012-01-26 19:00:56 +00:00
|
|
|
|
2010-12-10 22:57:22 +00:00
|
|
|
def has_required?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2010-02-03 14:56:27 +00:00
|
|
|
def skip_include_blank?
|
|
|
|
super || input_priority.present?
|
|
|
|
end
|
2010-01-09 15:05:02 +00:00
|
|
|
end
|
|
|
|
end
|
2010-12-10 22:57:22 +00:00
|
|
|
end
|