class SimpleForm::Inputs::CollectionInput

def detect_common_display_methods(collection_classes = detect_collection_classes)

def detect_common_display_methods(collection_classes = detect_collection_classes)
  collection_translated = translate_collection if collection_classes == [Symbol]
  if collection_translated || collection_classes.include?(Array)
    { :label => :first, :value => :last }
  elsif collection_includes_basic_objects?(collection_classes)
    { :label => :to_s, :value => :to_s }
  else
    sample = collection.first || collection.last
    { :label => SimpleForm.collection_label_methods.find { |m| sample.respond_to?(m) },
      :value => SimpleForm.collection_value_methods.find { |m| sample.respond_to?(m) } }
  end
end