module ActiveAdmin::Inputs::FilterBase

def collection_from_options

Override the standard finder to accept a proc
def collection_from_options
  if options[:collection].is_a?(Proc)
    options[:collection].call
  else
    super
  end
end

def humanized_method_name

Will use ActiveModel I18n if possible
Returns the default label for a given attribute
def humanized_method_name
  if object.base.respond_to?(:human_attribute_name)
    object.base.human_attribute_name(method)
  else
    method.to_s.send(builder.label_str_method)
  end
end

def input_wrapping(&block)

def input_wrapping(&block)
  template.content_tag(:div,
    template.capture(&block),
    wrapper_html_options
  )
end

def reflection_for(method)

Returns the association reflection for the method if it exists
def reflection_for(method)
  @object.base.reflect_on_association(method) if @object.base.respond_to?(:reflect_on_association)
end

def required?

def required?
  false
end

def wrapper_html_options

def wrapper_html_options
  { :class => "filter_form_field #{as}" }
end