Skip to content

Commit

Permalink
Prefer dependencies with exact name matches, Etag vs etag
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Oct 6, 2016
1 parent 93514c0 commit 817f6ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class Dependency < ActiveRecord::Base
after_create :update_project_id

def find_project_id
project_id = Project.platform(platform).where(name: project_name.strip).limit(1).pluck(:id).first
return project_id if project_id
Project.platform(platform).where('lower(name) = ?', project_name.downcase.strip).limit(1).pluck(:id).first
end

Expand Down

0 comments on commit 817f6ea

Please sign in to comment.