module ActiveAdmin::Filters::FormtasticAddons
def column_for(method)
def column_for(method) @object.base.columns_hash[method.to_s] if @object.base.respond_to?(:columns_hash) end
def foreign_key?(method)
def foreign_key?(method) @object.base.reflections.select{ |_,r| r.macro == :belongs_to }.values .map(&:foreign_key).include? method.to_s end
def humanized_method_name
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 polymorphic_foreign_type?(method)
def polymorphic_foreign_type?(method) type = Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0 ? proc{ |r| r.options[:foreign_type] } : :foreign_type @object.base.reflections.values.select{ |r| r.macro == :belongs_to && r.options[:polymorphic] } .map(&type).include? method.to_s end
def reflection_for(method)
def reflection_for(method) @object.base.reflect_on_association(method) if @object.base.respond_to?(:reflect_on_association) end