Skip to content

Commit

Permalink
Alternate way of fixing the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-bernhardt committed Oct 3, 2024
1 parent de1c5fe commit d586fa3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/detector/journal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def self.record(term)
result = full_term_match(term.phrase)
return unless result.any?

Detection.find_or_create_by(
Detection.current.find_or_create_by(
term:,
detector: Detector.where(name: 'Journal').first
)
Expand Down
2 changes: 1 addition & 1 deletion app/models/detector/standard_identifiers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def self.record(term)
si = Detector::StandardIdentifiers.new(term.phrase)

si.identifiers.each_key do |k|
Detection.find_or_create_by(
Detection.current.find_or_create_by(
term:,
detector: Detector.where(name: k.to_s.upcase).first
)
Expand Down
2 changes: 1 addition & 1 deletion app/models/detector/suggested_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def self.record(term)
result = full_term_match(term.phrase)
return unless result.any?

Detection.find_or_create_by(
Detection.current.find_or_create_by(
term:,
detector: Detector.where(name: 'SuggestedResource').first
)
Expand Down
2 changes: 1 addition & 1 deletion app/models/term.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def calculate_categorizations
# scores looks like [{3=>[0.91, 0.95]}, {1=>[0.1]}]
scores.map do |obj|
obj.map do |cat, vals|
Categorization.find_or_create_by(
Categorization.current.find_or_create_by(
term: self,
category: Category.where(id: cat).first,
confidence: calculate_confidence(vals)
Expand Down

0 comments on commit d586fa3

Please sign in to comment.