arsduo/koala — pull request #170 by iainbeeston (2012-03-06 02:13:03+00:00)
Title: Minor optimisation to the way that RealtimeUpdates.meet_challenge works

Currently in RealtimeUpdate#meet_challenge, you can pass in a block to check that the token from facebook is valid. This is always evaluated, even if other parts of the challenge (ie. the mode) are invalid (and therefore meet_challenge is always going to return false regardless of what's returned from the block)

In my case, inside the challenge block I load models from the database, and I wouldn't want this to happen if the meet_challenge is always going to return false.

I've added a test for this and fixed the "bug" (ie. added extra brackets to correct the binding).