Skip to content

Commit

Permalink
capability to search shipping category in admin
Browse files Browse the repository at this point in the history
Now that new admin allow for searching them, we had to allow name attrribute to be searchable via ransack
  • Loading branch information
loicginoux committed Apr 17, 2024
1 parent 0ad5cb7 commit 55ec39e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def row_url(shipping_category)
end

def search_key
:name_or_description_cont
:name_cont
end

def search_url
Expand Down
2 changes: 2 additions & 0 deletions core/app/models/spree/shipping_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module Spree
class ShippingCategory < Spree::Base
self.allowed_ransackable_attributes = %w[name]

validates :name, presence: true
has_many :products, inverse_of: :shipping_category
has_many :shipping_method_categories, inverse_of: :shipping_category
Expand Down

0 comments on commit 55ec39e

Please sign in to comment.