Investigate if subscription.active_version attribute is still needed
Context
This investigation is related to #15489.
Question
Do we still need the attribute subscription.active_version today?
Could we remove active_version, and then def active_product?(product) becomes simpler:
def active_product?(product)
# Remove these lines:
# return false unless product.rate_plan_charge.is_last_segment
#
# Keep only:
has_product_in_current_term?(product.rate_plan_charge)
end
Investigation Goals
- Identify all usages of
subscription.active_versionin the codebase - Determine if removing this attribute would break any existing functionality
- Evaluate the impact of simplifying
active_product?method - Assess if this refactoring is safe and beneficial
Related Code
- File:
app/models/subscription.rb - Method:
active_product? - Attribute:
subscription.active_version