Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select filter is not working #138

Open
kot-begemot opened this issue Apr 2, 2019 · 3 comments
Open

Select filter is not working #138

kot-begemot opened this issue Apr 2, 2019 · 3 comments
Labels

Comments

@kot-begemot
Copy link

kot-begemot commented Apr 2, 2019

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

@grzegorz-jakubiak
Copy link
Collaborator

Would you be willing to submit a PR?

@boie0025 boie0025 added the bug label Apr 15, 2019
@kot-begemot
Copy link
Author

Sure, I'll do

@grzegorz-jakubiak
Copy link
Collaborator

@kot-begemot please try this #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants