|
@@ -721,8 +721,10 @@ func newEntity(model Model, opts *Options) *Entity {
|
|
entity.lruCache, _ = lru.New(50)
|
|
entity.lruCache, _ = lru.New(50)
|
|
entity.reflectType = entity.reflectValue.Type()
|
|
entity.reflectType = entity.reflectValue.Type()
|
|
tableName := model.TableName()
|
|
tableName := model.TableName()
|
|
- if opts.RemoveTablePrefix && opts.TablePrefix != "" {
|
|
|
|
- tableName = strings.TrimLeft(tableName, opts.TablePrefix)
|
|
|
|
|
|
+ if opts.RemoveTablePrefix {
|
|
|
|
+ for _, prefix := range opts.TablePrefixes {
|
|
|
|
+ tableName = strings.TrimPrefix(tableName, prefix)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
entity.singularName = inflector.Singularize(tableName)
|
|
entity.singularName = inflector.Singularize(tableName)
|
|
entity.pluralizeName = inflector.Pluralize(tableName)
|
|
entity.pluralizeName = inflector.Pluralize(tableName)
|