From 93941a22d6d8fd95e870dd369e3249d0ec4f017e Mon Sep 17 00:00:00 2001 From: Rainer Dema Date: Tue, 5 Dec 2023 12:10:15 +0100 Subject: [PATCH] Add ransackable attributes for `Spree::Store` search in admin Enhanced the search capabilities in the admin panel by updating the `allowed_ransackable_attributes` of the `Spree::Store` model. --- core/app/models/spree/store.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb index 22e7ec113c2..1f269ab754e 100644 --- a/core/app/models/spree/store.rb +++ b/core/app/models/spree/store.rb @@ -22,6 +22,8 @@ class Store < Spree::Base validates :url, presence: true validates :mail_from_address, presence: true + self.allowed_ransackable_attributes = %w[name url code] + before_save :ensure_default_exists_and_is_unique before_destroy :validate_not_default