zh / redmine_importer

Redmine importer that works with trunk.
https://github.com/leovitch/redmine_importer/wiki
48 stars 57 forks source link

Use IssueQuery class instead of Query class. #4

Closed chocoby closed 11 years ago

chocoby commented 11 years ago

Need to call IssueQuery class to use the unique attr from Redmine 2.3.0.

chocoby commented 11 years ago

Sorry, I think I should use Query class in Redmine < 2.3.0...

like this:

# Use IssueQuery class in Redmine >= 2.3.0
begin
  if Module.const_get('IssueQuery') && IssueQuery.is_a?(Class)
    query_class = IssueQuery
  end
rescue NameError
  query_class = Query
end

query = query_class.new(:name => "_importer", :project => @project)
...

What do you think?

zh commented 11 years ago

Looks good. Better to be useful to as much people as possible. So if you think with this small fix different Redmine versions can be covered, let's implement this fix. Please send me pull request, will merge it ASAP.

chocoby commented 11 years ago

Okay, I will send pull request later. Thanks for merge :)