2
我試圖從Redmine中獲得問題,但有100個問題的限制。我試圖在模型中編寫一個方法來解決所有問題。下面是全班:從redmine獲取100多個問題
class IssueResource < ActiveResource::Base
self.site = 'http://127.0.0.1:5000'
self.element_name = "issue"
self.format = ActiveResource::Formats::XmlFormat
def self.search params
segment=IssueResource.find(:all,:params=>params)
issues=segment
while segment!= []
segment=IssueResource.find(:all,:params=>params,:having => "id < "+segment.last.id.to_s)
issues = issues+segment
end
return issues
end
end
正如你可以看到我試圖having
和發送多個請求,但它不工作。
PS:在參數總是有:極限=> 100