Skip to content

Commit

Permalink
Add ransackable attributes for Spree::PaymentMethod search in admin
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rainerdema committed Dec 1, 2023
1 parent fb15fd8 commit 6b3fe71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/app/models/spree/payment_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b3fe71

Please sign in to comment.