mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)
This commit is contained in:
@@ -101,11 +101,11 @@ func (c *Car) Update() *CarUpdateOne {
|
||||
// Unwrap unwraps the Car 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 (c *Car) Unwrap() *Car {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Car is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -114,11 +114,11 @@ func (c *Card) Update() *CardUpdateOne {
|
||||
// Unwrap unwraps the Card 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 (c *Card) Unwrap() *Card {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Card is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -109,11 +109,11 @@ func (i *Info) Update() *InfoUpdateOne {
|
||||
// Unwrap unwraps the Info 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 (i *Info) Unwrap() *Info {
|
||||
tx, ok := i.config.driver.(*txDriver)
|
||||
_tx, ok := i.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Info is not a transactional entity")
|
||||
}
|
||||
i.config.driver = tx.drv
|
||||
i.config.driver = _tx.drv
|
||||
return i
|
||||
}
|
||||
|
||||
|
||||
@@ -149,11 +149,11 @@ func (m *Metadata) Update() *MetadataUpdateOne {
|
||||
// Unwrap unwraps the Metadata 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 (m *Metadata) Unwrap() *Metadata {
|
||||
tx, ok := m.config.driver.(*txDriver)
|
||||
_tx, ok := m.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Metadata is not a transactional entity")
|
||||
}
|
||||
m.config.driver = tx.drv
|
||||
m.config.driver = _tx.drv
|
||||
return m
|
||||
}
|
||||
|
||||
|
||||
@@ -132,11 +132,11 @@ func (n *Node) Update() *NodeUpdateOne {
|
||||
// Unwrap unwraps the Node 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 (n *Node) Unwrap() *Node {
|
||||
tx, ok := n.config.driver.(*txDriver)
|
||||
_tx, ok := n.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Node is not a transactional entity")
|
||||
}
|
||||
n.config.driver = tx.drv
|
||||
n.config.driver = _tx.drv
|
||||
return n
|
||||
}
|
||||
|
||||
|
||||
@@ -104,11 +104,11 @@ func (pe *Pet) Update() *PetUpdateOne {
|
||||
// Unwrap unwraps the Pet 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 (pe *Pet) Unwrap() *Pet {
|
||||
tx, ok := pe.config.driver.(*txDriver)
|
||||
_tx, ok := pe.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Pet is not a transactional entity")
|
||||
}
|
||||
pe.config.driver = tx.drv
|
||||
pe.config.driver = _tx.drv
|
||||
return pe
|
||||
}
|
||||
|
||||
|
||||
@@ -115,11 +115,11 @@ func (po *Post) Update() *PostUpdateOne {
|
||||
// Unwrap unwraps the Post 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 (po *Post) Unwrap() *Post {
|
||||
tx, ok := po.config.driver.(*txDriver)
|
||||
_tx, ok := po.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Post is not a transactional entity")
|
||||
}
|
||||
po.config.driver = tx.drv
|
||||
po.config.driver = _tx.drv
|
||||
return po
|
||||
}
|
||||
|
||||
|
||||
@@ -148,11 +148,11 @@ func (r *Rental) Update() *RentalUpdateOne {
|
||||
// Unwrap unwraps the Rental 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 *Rental) Unwrap() *Rental {
|
||||
tx, ok := r.config.driver.(*txDriver)
|
||||
_tx, ok := r.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Rental is not a transactional entity")
|
||||
}
|
||||
r.config.driver = tx.drv
|
||||
r.config.driver = _tx.drv
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user