karmi/tire — pull request #185 by gedwards (2011-12-23 22:30:57+00:00)
Title: Lazy loading of Searches only when #results or #response called

I had a use case in the DSL where a previously created query needed to be modified.

search = Tire.search 'test' do query { string 'some_field:some_value' } end # don't perform the query yet

search.filter :terms, invite: ['yes'] # add an additional filter

search.results #now execute the query (so that query is executed only once)

This commit adds this ability (it was easy to do) and includes specs. As a bonus, it replaces many instances of ".perform.results" with the more simple ".results"