Skip to content

Commit

Permalink
Incorporated fix for project-specific category and version search
Browse files Browse the repository at this point in the history
from mschibata.
  • Loading branch information
Leo Hourvitz committed Jan 7, 2012
1 parent 8383ed4 commit c65c222
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/importer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def user_id_for_login!(login)
# will create a new version and save it when it doesn't exist yet.
def version_id_for_name!(project,name,add_versions)
if !@version_id_by_name.has_key?(name)
version = Version.find_by_name(name)
version = Version.find_by_project_id_and_name(project.id, name)
if !version
if name && (name.length > 0) && add_versions
version = project.versions.build(:name=>name)
Expand Down Expand Up @@ -235,7 +235,7 @@ def result
author = attrs_map["author"] ? user_for_login!(row[attrs_map["author"]]) : User.current
priority = Enumeration.find_by_name(row[attrs_map["priority"]])
category_name = row[attrs_map["category"]]
category = IssueCategory.find_by_name(category_name)
category = IssueCategory.find_by_project_id_and_name(project.id, category_name)
if (!category) && category_name && category_name.length > 0 && add_categories
category = project.issue_categories.build(:name => category_name)
category.save
Expand Down

1 comment on commit c65c222

@huonanwang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dddd

Please sign in to comment.