simplified the conditional
Dieser Commit ist enthalten in:
Ursprung
6754d744f0
Commit
33e457a5c9
1 geänderte Dateien mit 2 neuen und 4 gelöschten Zeilen
|
@ -33,11 +33,9 @@ class CustomWizard::RealtimeValidation::SimilarTopics
|
|||
topics = Topic.similar_to(title, raw, user).to_a
|
||||
topics.select! { |t| categories.include?(t.category.id.to_s) } if categories.present?
|
||||
|
||||
if time_n_value.present? and time_unit.present?
|
||||
if time_n_value.to_i > 0
|
||||
if time_n_value.to_i > 0 && time_unit.present?
|
||||
topics.select! { |t| t.created_at >= time_n_value.to_i.send(time_unit).ago }
|
||||
end
|
||||
end
|
||||
topics.map! { |t| SimilarTopic.new(t) }
|
||||
|
||||
result.items = topics
|
||||
|
|
Laden …
In neuem Issue referenzieren