def has_staff_with_role?(role_name) staffs.each do |staff| if staff.has_role?(role_name) return true end end return false end
return true if staff.has_role?(role_name)
def has_staff_with_role?(role_name) staffs.any?{|staff| staff.has_role? role_name } end
#2 楼 @luikore 连赞 32 个
@luikore 赞一个