method
new?
v3.2.8 -
Show latest stable
- Class:
ActiveResource::Base
new?()public
Returns true if this object hasn’t yet been saved, otherwise, returns false.
Examples
not_new = Computer.create(:brand => 'Apple', :make => 'MacBook', :vendor => 'MacMall') not_new.new? # => false is_new = Computer.new(:brand => 'IBM', :make => 'Thinkpad', :vendor => 'IBM') is_new.new? # => true is_new.save is_new.new? # => false
1Note
Corrected link to ActiveRecord's "new_record?" method
rafaelrosafu, the correct tink to ActiveRecord's "new_record?" method is: