mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/mutation: explain when object is fetched from db (#496)
This commit is contained in:
@@ -138,7 +138,9 @@ func (m *CityMutation) Name() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldName returns the old name value, if exists.
|
||||
// OldName returns the old name value of the City.
|
||||
// If the City object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *CityMutation) OldName(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
@@ -504,7 +506,9 @@ func (m *StreetMutation) Name() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldName returns the old name value, if exists.
|
||||
// OldName returns the old name value of the Street.
|
||||
// If the Street object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *StreetMutation) OldName(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
|
||||
Reference in New Issue
Block a user