Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
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,10 +33,8 @@ class CustomWizard::RealtimeValidation::SimilarTopics
|
||||||
topics = Topic.similar_to(title, raw, user).to_a
|
topics = Topic.similar_to(title, raw, user).to_a
|
||||||
topics.select! { |t| categories.include?(t.category.id.to_s) } if categories.present?
|
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 && time_unit.present?
|
||||||
if time_n_value.to_i > 0
|
topics.select! { |t| t.created_at >= time_n_value.to_i.send(time_unit).ago }
|
||||||
topics.select! { |t| t.created_at >= time_n_value.to_i.send(time_unit).ago }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
topics.map! { |t| SimilarTopic.new(t) }
|
topics.map! { |t| SimilarTopic.new(t) }
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren