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

  1. Identify all usages of subscription.active_version in the codebase
  2. Determine if removing this attribute would break any existing functionality
  3. Evaluate the impact of simplifying active_product? method
  4. Assess if this refactoring is safe and beneficial

Related Code

  • File: app/models/subscription.rb
  • Method: active_product?
  • Attribute: subscription.active_version
Assignee Loading
Time tracking Loading