You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love this gem btw. Thanks for making it! I'm up and running and was wondering:
How can I restrict/control the name of a named group?
I'd thought about
classGroupMembership < Groupify::ActiveRecord::NamedGroupCollectionvalidates_format_of:group_name,with: /\AWingedLoraxOfThe(North|South|East|West)/Z/
end
To make sure my Lorax's are only the winged variety of the cardinal directions. Would this be the best-practice or is there perhaps something inside the docs I've missed for doing the same thing?
The text was updated successfully, but these errors were encountered:
There is no configuration option to support that currently. Your sample code looks like it will work for your use case. (Note that GroupMembership should inherit from ActiveRecord::Base.)
The problem with this strategy in general is that different classes can also have named group memberships, and you might want to have different validation rules (or none) for those classes.
I love this gem btw. Thanks for making it! I'm up and running and was wondering:
I'd thought about
To make sure my Lorax's are only the winged variety of the cardinal directions. Would this be the best-practice or is there perhaps something inside the docs I've missed for doing the same thing?
The text was updated successfully, but these errors were encountered: