我在模型上定义了几个作用域,并在rails_admin中使用它们。RailsAdmin - 将参数传递到作用域
scope :foo , ->() { where(status: 'active')}
...
list do
scopes [nil, 'foo']
我想创建范围,我可以传递参数,然后从rails_admin加载这些范围。事情是这样的:
scope :bar , ->(query) { where(status: query)}
但因为RA没有通过参数我不断收到
wrong number of arguments (0 for 1)
有没有人有什么建议?我正在使用Rails 4.1.14与rails_admin 0.8.1和mongoid 5.0