Skip to content

Select filter is not working #138

Description

@kot-begemot

Spec:

activeadmin (1.4.3)
activeadmin-mongoid (0.8.0)
  remote: https://github.com/activeadmin/activeadmin-mongoid.git
  revision: ff45b6379cec574e687548b607cad225fd2cf403
  branch: master
 ransack-mongoid (0.1.0)
  remote: https://github.com/activerecord-hackery/ransack-mongoid.git
  revision: bd1935293d2f285fa7cf33d2c5c90d981bf67338

Error
undefined method +' for nil:NilClass`

Reported line
activeadmin (1.4.3) lib/active_admin/inputs/filters/select_input.rb

Active admin setup:

ActiveAdmin.register SellOrder do
  actions :all, :except => [:new, :edit, :destroy]

  index do
    selectable_column
    column :name
    column :user
    column "Domains" do |sell_order|
      sell_order.domains.count
    end
    column :state
    actions
  end

  filter :name
  filter :state, as: :select, collection: SellOrder.state_machine.states.map(&:name)
  filter :created_at

  show do
     ...
  end
end

Investigation
activeadmin-mongoid substitutes method searchable_method_name with broken equivalent, while original method itself works like a charm

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions