Entonces alli esta
record.new_record?
Para comprobar si algo es nuevo
Necesito comprobar si algo está saliendo.
record = some_magic
record.destroy
record.is_destroyed? # => true
Something like that. I know destroying freezes the object, so frozen? sort of works, but is there something explicitly for this task?
fuente
object.destroyed?
DEPRECATION WARNING: You are passing an instance of ActiveRecord::Base to
exists?. Please pass the id of the object by calling
.id.
Record.exists?
in controller specs, because I can't reload destroyed record to check if it isdestroyed?
. But if I have instance variable to check withassings
, then I can usedestroyed?
.