Skip to content

Commit

Permalink
exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Jun 11, 2019
1 parent 04101d9 commit 94341fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/confidence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ class Confidence < ApplicationRecord
accepts_nested_attributes_for :confidence_level, allow_destroy: true


def self.exists?(global_id, confidence_level_id, project_id)
o = GlobalID::Locator.locate(global_id)
return false unless o
Confidence.where(project_id: project_id, tag_object: o, confidence_level_id: confidence_level_id).first
end


end

0 comments on commit 94341fe

Please sign in to comment.