This is clearer imo

This commit is contained in:
Jorge Manrubia
2025-06-04 12:12:06 +02:00
parent ae1ad9c509
commit f3e6f1e5e0
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -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
-2
View File
@@ -1,5 +1,3 @@
class Entropy::Configuration < ApplicationRecord
belongs_to :container, polymorphic: true
scope :default, -> { where(container_type: "Account").limit(1) }
end