This commit is contained in:
Chris Tsang 2022-05-15 17:44:23 +08:00
parent 1984a70cc4
commit 1609e4c743

View File

@ -549,7 +549,7 @@ pub trait ActiveModelTrait: Clone + Debug {
Ok(am)
}
/// Returns `true` if any columns were changed.
/// Return `true` if any field of `ActiveModel` is `Set`
fn is_changed(&self) -> bool {
<Self::Entity as EntityTrait>::Column::iter()
.any(|col| self.get(col).is_set() && !self.get(col).is_unchanged())