Having two different sort of validate, from user or app itself in rails -
my program trying create groups automatically, prefix of 'automated_group', won't show when loading groups, can't edited, , more stuff. have limit users doing it. if make validate function, won't let app , group.save returns false. when updating other attributes, won't let me save it, cause name won't validate.
is there other way? use validation, or maybe check who's changing value?
thanks in advance
you can use permission system cancan (https://github.com/ryanb/cancan). can define someting this:
can :manage, group, automated_group: false
Comments
Post a Comment