Sha256: ccfeb7baf0767524100892b53912c4f6bb5a6ce5b54fa0e26669d63237b7a8bd

Contents?: true

Size: 540 Bytes

Versions: 12

Compression:

Stored size: 540 Bytes

Contents

module ActiveAdminAddons
  module FilterInputMethods
    include InputMethods

    def object_class
      valid_object.klass
    end

    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

    def eq_input_name
      "#{valid_method}_eq"
    end

    def gteq_input_name
      "#{method}_gteq"
    end

    def lteq_input_name
      "#{method}_lteq"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
activeadmin_addons-1.7.1 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.7.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.6.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.5.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.4.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.3.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.2.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.1.2 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.1.1 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.1.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.0.1 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.0.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb