From f3e6f1e5e01bdf962425cae2b81c2fba0fca4576 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 4 Jun 2025 12:12:06 +0200 Subject: [PATCH] This is clearer imo --- app/models/card/entropy.rb | 2 +- app/models/entropy/configuration.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/card/entropy.rb b/app/models/card/entropy.rb index 874c87ddd..3b988f00d 100644 --- a/app/models/card/entropy.rb +++ b/app/models/card/entropy.rb @@ -8,7 +8,7 @@ module Card::Entropy 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.to_sql) + Entropy::Configuration.where(id: Account.sole.default_entropy_configuration).limit(1).to_sql) end scope :stagnated, -> do diff --git a/app/models/entropy/configuration.rb b/app/models/entropy/configuration.rb index 995f49840..72370670f 100644 --- a/app/models/entropy/configuration.rb +++ b/app/models/entropy/configuration.rb @@ -1,5 +1,3 @@ class Entropy::Configuration < ApplicationRecord belongs_to :container, polymorphic: true - - scope :default, -> { where(container_type: "Account").limit(1) } end