The problem with "recommended" is that it had identical singular and plural, which means it wasn't clear whether we were using it to refer to an item of a collection or to refer to the collection itself.
15 lines
488 B
Ruby
15 lines
488 B
Ruby
class Shared::RecommendedIndexComponent < ApplicationComponent
|
|
attr_reader :recommendations, :disable_recommendations_path, :namespace
|
|
use_helpers :current_path_with_query_params
|
|
|
|
def initialize(recommendations, disable_recommendations_path:, namespace:)
|
|
@recommendations = recommendations
|
|
@disable_recommendations_path = disable_recommendations_path
|
|
@namespace = namespace
|
|
end
|
|
|
|
def render?
|
|
feature?("user.recommendations") && recommendations.present?
|
|
end
|
|
end
|