Sha256: e1fa4af468f8392aba39d0a29f6e9b3f22c99bcbff792b27c897d512e4635491

Contents?: true

Size: 574 Bytes

Versions: 7

Compression:

Stored size: 574 Bytes

Contents

require_relative "input_methods"

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

7 entries across 7 versions & 2 rubygems

Version Path
activeadmin_addons-1.10.1 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-2.0.0.beta.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.10.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.9.0 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.8.3 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons-1.8.2 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb
activeadmin_addons_rails6-1.7.2 lib/activeadmin_addons/support/input_helpers/filter_input_methods.rb