You're viewing Avo 2 docs — go to Avo 4

Skip to content

attach_scope

Scope out the records the user sees on the Attach modal.

Default ​

nil

Possible values ​

ruby
field :user,
  as: :belongs_to,
  attach_scope: -> { query.non_admins }

Pass in a block where you attach scopes to the query object. The block is executed in the AssociationScopeHost, so follow the docs to see what variables you have access to.