instance method
persisted?
Ruby on Rails 5.2.8.1
Since v3.0.20Signature
persisted?()
Returns true if the record is persisted, i.e. it’s not a new record and it was not destroyed, otherwise returns false.
Source
# File activerecord/lib/active_record/persistence.rb, line 244
def persisted?
sync_with_transaction_state
!(@new_record || @destroyed)
end
Defined in activerecord/lib/active_record/persistence.rb line 244
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence