|
|
|
@ -1,8 +1,11 @@
|
|
|
|
class SubcategoryCardPresenter
|
|
|
|
class SubcategoryCardPresenter
|
|
|
|
attr_reader :name
|
|
|
|
attr_reader :name, :subcategory, :category, :subcategory_id
|
|
|
|
|
|
|
|
|
|
|
|
def initialize(name:, zones:, score:)
|
|
|
|
def initialize(subcategory:, zones:, score:)
|
|
|
|
@name = name
|
|
|
|
@name = subcategory.name
|
|
|
|
|
|
|
|
@subcategory = subcategory
|
|
|
|
|
|
|
|
@category = subcategory.category
|
|
|
|
|
|
|
|
@subcategory_id = subcategory.subcategory_id
|
|
|
|
@zones = zones
|
|
|
|
@zones = zones
|
|
|
|
@score = score
|
|
|
|
@score = score
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@ -19,6 +22,10 @@ class SubcategoryCardPresenter
|
|
|
|
zone.type == :insufficient_data
|
|
|
|
zone.type == :insufficient_data
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def to_model
|
|
|
|
|
|
|
|
subcategory
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
|
|
def zone
|
|
|
|
def zone
|
|
|
|
|