discourse/discourse — pull request #2176 by dreamr (2014-03-25 07:14:02+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.