method

persisted?

rails latest stable - Class: ActiveResource::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

persisted?()
public

Returns true if this object has been saved, otherwise returns false.

Examples

persisted = Computer.create(:brand => 'Apple', :make => 'MacBook', :vendor => 'MacMall')
persisted.persisted? # => true

not_persisted = Computer.new(:brand => 'IBM', :make => 'Thinkpad', :vendor => 'IBM')
not_persisted.persisted? # => false

not_persisted.save
not_persisted.persisted? # => true