From b8b8a2fa0369af59183a00085b402d6652b40df6 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 4 Jun 2025 12:58:17 +0200 Subject: [PATCH] Simpler --- app/models/card/entropy.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/card/entropy.rb b/app/models/card/entropy.rb index 41fcd4cfd..0a4e19c79 100644 --- a/app/models/card/entropy.rb +++ b/app/models/card/entropy.rb @@ -7,8 +7,7 @@ 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.where(id: Entropy::Configuration.default).select(period_name).limit(1)) + .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) }