Active Admin scopes for each instance of a related model

前端 未结 6 1787
灰色年华
灰色年华 2020-12-30 11:26

I have an issue with a dynamic active admin scope. I am attempting to create a scope for each \"manager\" of a \"project\" in my app. However, the scopes don\'t seem to up

6条回答
  •  盖世英雄少女心
    2020-12-30 12:20

    I found this to work for me:

    ActiveAdmin file

    scope :working, :default => true do |projects|
      Project.working
    end
    

    Model

    scope :working, -> { where(:status => 'working') }
    

    A bit late in the reply but hopefully it helps someone out.

提交回复
热议问题