Skip to content

Instantly share code, notes, and snippets.

@sabbaticaldev
Created May 17, 2013 20:04
Show Gist options
  • Save sabbaticaldev/5601649 to your computer and use it in GitHub Desktop.
Save sabbaticaldev/5601649 to your computer and use it in GitHub Desktop.
def more_like_this
@response = Tire::Configuration.client.get(Tire::Configuration.url + "/#{self.class.to_s.pluralize.downcase}/#{self.class.to_s.downcase}/#{id}/_mlt")
if @response.failure?
STDERR.puts "[REQUEST FAILED] #{self.to_curl}\n"
raise SearchRequestFailed, @response.to_s
end
@json = MultiJson.decode(@response.body)
Tire::Results::Collection.new(@json, {})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment