From c8a9b18428e2d8e7b5de46d9bb4a0f3a80d0530d Mon Sep 17 00:00:00 2001 From: TeoV Date: Mon, 18 May 2020 12:54:11 +0300 Subject: [PATCH] Uniformize the logic for model_helpers for TPRoutes --- engine/model_helpers.go | 12 +++++------- packages/debian/changelog | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engine/model_helpers.go b/engine/model_helpers.go index 535dece20c..f941614891 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -1933,14 +1933,12 @@ func (tps TPRoutes) AsTPRouteProfile() (result []*utils.TPRouteProfile) { sup, found := routeMap[tenID][routeID] if !found { sup = &utils.TPRoute{ - ID: tp.RouteID, - Weight: tp.RouteWeight, - Blocker: tp.RouteBlocker, + ID: tp.RouteID, + Weight: tp.RouteWeight, + Blocker: tp.RouteBlocker, + RouteParameters: tp.RouteParameters, } } - if tp.RouteParameters != utils.EmptyString { - sup.RouteParameters = tp.RouteParameters - } if tp.RouteFilterIDs != utils.EmptyString { supFilterSplit := strings.Split(tp.RouteFilterIDs, utils.INFIELD_SEP) sup.FilterIDs = append(sup.FilterIDs, supFilterSplit...) @@ -1978,7 +1976,7 @@ func (tps TPRoutes) AsTPRouteProfile() (result []*utils.TPRouteProfile) { if tp.Weight != 0 { th.Weight = tp.Weight } - if len(tp.ActivationInterval) != 0 { + if tp.ActivationInterval != utils.EmptyString { th.ActivationInterval = new(utils.TPActivationInterval) aiSplt := strings.Split(tp.ActivationInterval, utils.INFIELD_SEP) if len(aiSplt) == 2 { diff --git a/packages/debian/changelog b/packages/debian/changelog index 47e8d93575..8e805e4676 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -57,6 +57,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium * [General] Default timingIDs start from time.Now() (i.e. *monthly time.Now() + 1 month ) * [AgentS] FieldAsInterface return data instead of NMItem * [RouteS] Add posibility to load routes with the sameID and different filters + * [RouteS] Correctly populate Sorting out of models -- Alexandru Tripon Wed, 19 Feb 2020 13:25:52 +0200