mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
fix silly misthought
This commit is contained in:
parent
2e4f2d388e
commit
f5ab3c399a
@ -15,11 +15,12 @@ class CacheMostUsedAttributeCategoriesJob < ApplicationJob
|
||||
puts "Suggestion count: #{suggestions}"
|
||||
|
||||
suggestions.each do |suggestion, weight|
|
||||
AttributeCategorySuggestion.find_or_create_by!(
|
||||
suggestion = AttributeCategorySuggestion.find_or_create_by!(
|
||||
entity_type: entity_type,
|
||||
suggestion: suggestion,
|
||||
weight: weight
|
||||
suggestion: suggestion
|
||||
)
|
||||
suggestion.weight = weight
|
||||
suggestion.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -21,12 +21,13 @@ class CacheMostUsedAttributeFieldsJob < ApplicationJob
|
||||
puts "Suggestion count: #{suggestions}"
|
||||
|
||||
suggestions.each do |suggestion, weight|
|
||||
AttributeFieldSuggestion.find_or_create_by!(
|
||||
suggestion = AttributeFieldSuggestion.find_or_initialize_by(
|
||||
entity_type: entity_type,
|
||||
category_label: category_label,
|
||||
suggestion: suggestion,
|
||||
weight: weight
|
||||
suggestion: suggestion
|
||||
)
|
||||
suggestion.weight = weight
|
||||
suggestion.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user