Skip to Content Skip to Search
Methods
I
S

Instance Public methods

index()

# File app/controllers/v2/plans_controller.rb, line 6
def index
  plans = current_site.plans.is_public.enabled.reject(&:specific_time_expired?)

  render json: plans, status: :ok, each_serializer: Plan::MinimalSerializer
end

show()

# File app/controllers/v2/plans_controller.rb, line 12
def show
  if upcoming_invoice_errors.present?
    return render_error(formatted_upcoming_invoice_errors, :bad_gateway)
  end

  serialization_options = if @plan.enabled?
    {
      serializer: Plan::PlanSerializer,
      member: current_entity,
      upcoming_invoice:
    }
  else
    {serializer: Plan::DisabledSerializer}
  end

  render json: @plan, status: :ok, **serialization_options
end