Created by: zamith
Why:
- Many times we want to select from a list of resources that is scope. For instance, a user might be scoped by role.
This change addresses the need by:
- Allowing an option to be passed to the
HasMany
field, with a proc to be run
Usage:
ATTRIBUTE_TYPES = {
admins: Field::HasMany.with_options(class_name: "User", scope: -> { User.admins }),
}
Fixes #331 (closed)