diaspora/diaspora — pull request #3657 by grzuy (2012-10-13 19:44:58+00:00)
Title: Refactor MessagesController

* Remove inclusion of ApplicationHelper (anyone knows why it was included?)
* Simplify the lookup for the conversation. I am not sure why it was done that way before. I suppose it was joined with the visibilities to get no result in case the current user is not a participant of the conversation. The thing is that this validation is already on the Message model, where it belongs. So now if you hack the message html form action path to post to a conversation you're not a participant you get an "Invalid message" flash message, not the empty response with a 422 status code.
* Cleaner build for the message.

Tests:

* Clean the setup, no need for those instance variables.
* Clearer variables names, be verbose if we need to :)
* Other minor changes...