From 6b3fe71463ff47617582885d8cdd15f54618b186 Mon Sep 17 00:00:00 2001 From: Rainer Dema Date: Fri, 1 Dec 2023 11:49:55 +0100 Subject: [PATCH] Add ransackable attributes for `Spree::PaymentMethod` search in admin Enhanced the search capabilities in the admin panel by updating the `allowed_ransackable_attributes` of the `Spree::PaymentMethod` model. This update specifically adds the `name` and `description` fields to the list of attributes that can be searched using Ransack. --- core/app/models/spree/payment_method.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/app/models/spree/payment_method.rb b/core/app/models/spree/payment_method.rb index c74bb03701e..18547815ab3 100644 --- a/core/app/models/spree/payment_method.rb +++ b/core/app/models/spree/payment_method.rb @@ -42,6 +42,8 @@ class UnsupportedPaymentMethod < StandardError; end include Spree::Preferences::StaticallyConfigurable + self.allowed_ransackable_attributes = %w[name description] + # Custom ModelName#human implementation to ensure we don't refer to # subclasses as just "PaymentMethod" class ModelName < ActiveModel::Name