Skip to content

Commit

Permalink
fix: Remove underscores from the getFullTableName method when they ar…
Browse files Browse the repository at this point in the history
…e present
  • Loading branch information
chenxi2015 committed Jul 19, 2024
1 parent 908d5f5 commit 2af56fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ func (a *Adapter) getTableInstance() *CasbinRule {

func (a *Adapter) getFullTableName() string {
if a.tablePrefix != "" {
return a.tablePrefix + a.tableName
if strings.HasSuffix(a.tablePrefix, "_") {
return a.tablePrefix + a.tableName
}
return a.tablePrefix + "_" + a.tableName
}
return a.tableName
}
Expand Down

0 comments on commit 2af56fa

Please sign in to comment.