Skip to content

Commit

Permalink
Uniformize the logic for model_helpers for TPRoutes
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoV authored and danbogos committed May 18, 2020
1 parent 2a61854 commit c8a9b18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 5 additions & 7 deletions engine/model_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions packages/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> Wed, 19 Feb 2020 13:25:52 +0200

Expand Down

0 comments on commit c8a9b18

Please sign in to comment.