Module: ActiveAdminAddons::FilterInputMethods

Includes:
InputMethods
Included in:
FilterInput
Defined in:
lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb

Instance Method Summary collapse

Methods included from InputMethods

#association_name, #build_virtual_attr, #input_association_value, #input_related_items, #method_model, #model_name, #tableize_method, #translated_method, #url_from_method, #valid_method, #valid_object

Instance Method Details

#eq_input_nameObject



20
21
22
# File 'lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb', line 20

def eq_input_name
  "#{valid_method}_eq"
end

#gteq_input_nameObject



24
25
26
# File 'lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb', line 24

def gteq_input_name
  "#{method}_gteq"
end

#input_valueObject



11
12
13
14
15
16
17
18
# File 'lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb', line 11

def input_value
  result = valid_object.conditions.find do |condition|
    condition.attributes.map(&:name).include?(valid_method.to_s)
  end

  return unless result
  result.values.first.value
end

#lteq_input_nameObject



28
29
30
# File 'lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb', line 28

def lteq_input_name
  "#{method}_lteq"
end

#object_classObject



7
8
9
# File 'lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb', line 7

def object_class
  valid_object.klass
end