Class: Improvements::RatingBoost

Inherits:
Improvement show all
Defined in:
app/models/improvements/rating_boost.rb

Overview

This is for Improvements like “Get 1 Weird, max 3”

Constant Summary collapse

RATINGS_SELECT =
{ rating: { data: Rating::LIST, count: 1 } }.freeze

Constants inherited from Improvement

Improvement::IMPROVEMENT_TYPES

Instance Attribute Summary

Attributes inherited from Improvement

#advanced, #created_at, #description, #id, #playbook_id, #rating, #stat_limit, #type, #updated_at

Instance Method Summary collapse

Methods inherited from Improvement

advanced_eligible?, policy_class

Methods inherited from ApplicationRecord

policy_class

Instance Method Details

#configured_rating(hunters_improvement) ⇒ Object


39
40
41
# File 'app/models/improvements/rating_boost.rb', line 39

def configured_rating(hunters_improvement)
  rating || hunters_improvement.improvable&.dig('rating')
end

#improvable_options(_hunter) ⇒ Object


43
44
45
# File 'app/models/improvements/rating_boost.rb', line 43

def improvable_options(_hunter)
  rating ? {} : RATINGS_SELECT
end