mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
11200: rename products scope
This commit is contained in:
@@ -44,7 +44,7 @@ module Admin
|
||||
# if user hasn't saved any preferences on products page and there's only one producer;
|
||||
# we need to hide producer column
|
||||
def hide_producer_column?(producer_options)
|
||||
spree_current_user.column_preferences.products.empty? && producer_options.one?
|
||||
spree_current_user.column_preferences.bulk_edit_product.empty? && producer_options.one?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ class ColumnPreference < ApplicationRecord
|
||||
validates :column_name, presence: true, inclusion: { in: proc { |p|
|
||||
valid_columns_for(p.action_name)
|
||||
} }
|
||||
scope :products, -> { where(action_name: 'products_v3_index') }
|
||||
scope :bulk_edit_product, -> { where(action_name: 'products_v3_index') }
|
||||
|
||||
def self.for(user, action_name)
|
||||
stored_preferences = where(user_id: user.id, action_name:)
|
||||
|
||||
Reference in New Issue
Block a user