discourse/discourse — pull request #2177 by thatrubylove (2014-03-25 08:05:14+00:00)
Title: [refactor] Topics#set_auto_close

The large complicated conditional block has been refactored away
using an object that returns a lambda with the correct behavior
to update the topic auto close date.

Topics::AutoCloser.get_closer_method(arg).call(self)

* arg: The arg is a date string of various formats or nil
* self: The object with the auto_close fields

This will improve your code climate score and remove an eye-sore
conditional mess.

* Added new object in lib, Topics::AutoCloser
* Added integrartion tests for the new object