Question about validations

Hello,

Well I have implemented in my app a wall similar to the one found on facebooks user profiles. I have created a wall_comments controller and wall_comment model. Only friends can post in each others wall. On my views I check that if the current user is not friend of a particular user the form for posting a comments is not shown. On the wall_comments controller I have a before_filter for the create action that checks if the two users are friends. And on my wall_comment model I have a validate_on_save method that checks again if the two users are friends again.

Is this a good practice? That much validations? More queries, slower response times? Any suggestions or is it ok like that?

Thanks,

Elioncho

I'd drop the before_filter for the create action, since you're already doing validations on the model side.

I'll take your approach then. I'll make a validate_con_create method on the wall_comment model. Thanks,

Elioncho

I'll take your approach then. I'll make a validate_con_create method on the wall_comment model. Thanks,

Elioncho