-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I'm following the rest code example, and I'm having this error in the guards:
I already implemented check()
, but the error continues
module Rest
module Guard
class UserValidator < Shivneri::Guard
@[Inject("as_body")]
@[BodySameAs("UserController", "add_user")]
def check(user)
err_message = validate user
if (err_message.size > 0)
return text_result(err_message, 400)
end
end
def validate(user)
if (user.name.size < 5)
return "name should be minimum 5 characters"
elsif (!["male", "female"].include? user.gender)
return "gender should be either male of female"
end
return ""
end
end
end
end
Metadata
Metadata
Assignees
Labels
No labels