mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)
This commit is contained in:
@@ -148,11 +148,11 @@ func (f *Friendship) Update() *FriendshipUpdateOne {
|
||||
// Unwrap unwraps the Friendship entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (f *Friendship) Unwrap() *Friendship {
|
||||
tx, ok := f.config.driver.(*txDriver)
|
||||
_tx, ok := f.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Friendship is not a transactional entity")
|
||||
}
|
||||
f.config.driver = tx.drv
|
||||
f.config.driver = _tx.drv
|
||||
return f
|
||||
}
|
||||
|
||||
|
||||
@@ -112,11 +112,11 @@ func (gr *Group) Update() *GroupUpdateOne {
|
||||
// Unwrap unwraps the Group entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (gr *Group) Unwrap() *Group {
|
||||
tx, ok := gr.config.driver.(*txDriver)
|
||||
_tx, ok := gr.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Group is not a transactional entity")
|
||||
}
|
||||
gr.config.driver = tx.drv
|
||||
gr.config.driver = _tx.drv
|
||||
return gr
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +129,11 @@ func (r *Relationship) Update() *RelationshipUpdateOne {
|
||||
// Unwrap unwraps the Relationship entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (r *Relationship) Unwrap() *Relationship {
|
||||
tx, ok := r.config.driver.(*txDriver)
|
||||
_tx, ok := r.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Relationship is not a transactional entity")
|
||||
}
|
||||
r.config.driver = tx.drv
|
||||
r.config.driver = _tx.drv
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
@@ -144,11 +144,11 @@ func (t *Tweet) Update() *TweetUpdateOne {
|
||||
// Unwrap unwraps the Tweet entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (t *Tweet) Unwrap() *Tweet {
|
||||
tx, ok := t.config.driver.(*txDriver)
|
||||
_tx, ok := t.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Tweet is not a transactional entity")
|
||||
}
|
||||
t.config.driver = tx.drv
|
||||
t.config.driver = _tx.drv
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ func (tl *TweetLike) Update() *TweetLikeUpdateOne {
|
||||
// Unwrap unwraps the TweetLike entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (tl *TweetLike) Unwrap() *TweetLike {
|
||||
tx, ok := tl.config.driver.(*txDriver)
|
||||
_tx, ok := tl.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: TweetLike is not a transactional entity")
|
||||
}
|
||||
tl.config.driver = tx.drv
|
||||
tl.config.driver = _tx.drv
|
||||
return tl
|
||||
}
|
||||
|
||||
|
||||
@@ -240,11 +240,11 @@ func (u *User) Update() *UserUpdateOne {
|
||||
// Unwrap unwraps the User entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (u *User) Unwrap() *User {
|
||||
tx, ok := u.config.driver.(*txDriver)
|
||||
_tx, ok := u.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: User is not a transactional entity")
|
||||
}
|
||||
u.config.driver = tx.drv
|
||||
u.config.driver = _tx.drv
|
||||
return u
|
||||
}
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ func (ug *UserGroup) Update() *UserGroupUpdateOne {
|
||||
// Unwrap unwraps the UserGroup entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (ug *UserGroup) Unwrap() *UserGroup {
|
||||
tx, ok := ug.config.driver.(*txDriver)
|
||||
_tx, ok := ug.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: UserGroup is not a transactional entity")
|
||||
}
|
||||
ug.config.driver = tx.drv
|
||||
ug.config.driver = _tx.drv
|
||||
return ug
|
||||
}
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ func (ut *UserTweet) Update() *UserTweetUpdateOne {
|
||||
// Unwrap unwraps the UserTweet entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (ut *UserTweet) Unwrap() *UserTweet {
|
||||
tx, ok := ut.config.driver.(*txDriver)
|
||||
_tx, ok := ut.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: UserTweet is not a transactional entity")
|
||||
}
|
||||
ut.config.driver = tx.drv
|
||||
ut.config.driver = _tx.drv
|
||||
return ut
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user