Open isaacfreeman opened 11 years ago
Breeze::Admin::User has a method_missing method whose only purpose is to provide convenience methods for CanCan roles
e.g. user.admin? instead of user.roles.include? :admin
user.admin?
user.roles.include? :admin
I think the latter code is easier to interpret (it tells you that admin is a role), so I'd like to remove the method_missing.
admin
def method_missing(sym, *args) if sym.to_s =~ /^(\w+)\?$/ && CORE_ROLES.include?($1.to_sym) roles.include? $1.to_sym else super end end
Breeze::Admin::User has a method_missing method whose only purpose is to provide convenience methods for CanCan roles
e.g.
user.admin?
instead ofuser.roles.include? :admin
I think the latter code is easier to interpret (it tells you that
admin
is a role), so I'd like to remove the method_missing.