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