This commit is contained in:
Jorge Manrubia
2025-06-04 12:58:33 +02:00
parent b8b8a2fa03
commit b35aefd07b
+2 -1
View File
@@ -7,7 +7,8 @@ module Card::Entropy
included do
scope :entropic_by, ->(period_name) do
left_outer_joins(collection: :entropy_configuration)
.where("last_active_at <= DATETIME('now', '-' || COALESCE(entropy_configurations.#{period_name}, (?)) || ' seconds')", Entropy::Configuration.default.public_send(period_name))
.where("last_active_at <= DATETIME('now', '-' || COALESCE(entropy_configurations.#{period_name}, (?)) || ' seconds')",
Entropy::Configuration.default.public_send(period_name))
end
scope :stagnated, -> { doing.entropic_by(:auto_reconsider_period) }