method

dup

Importance_2
v3.0.9 - Show latest stable - 1 note - Class: ActiveResource::Base
dup() public

Duplicates the current resource without saving it.

Examples

my_invoice = Invoice.create(:customer => 'That Company') next_invoice = my_invoice.dup next_invoice.new? # => true next_invoice.save next_invoice == my_invoice # => false (different id attributes) my_invoice.customer # => That Company next_invoice.customer # => That Company
Show source