module Formtastic::Helpers::FileColumnDetection

@private

Public Instance Methods

is_file?(method, options = {}) click to toggle source
# File lib/formtastic/helpers/file_column_detection.rb, line 6
def is_file?(method, options = {})
  @files ||= {}
  @files[method] ||= (options[:as].present? && options[:as] == :file) || begin
    file = @object.send(method) if @object && @object.respond_to?(method)
    file && file_methods.any?{|m| file.respond_to?(m)}
  end
end