method
    
    dup
  
      v4.2.1 - 
      Show latest stable
 - 
    1 note - 
    Class: Core
    
  
  
- 1.0.0
 - 1.1.6
 - 1.2.6
 - 2.0.3
 - 2.1.0
 - 2.2.1
 - 2.3.8
 - 3.0.0
 - 3.0.9
 - 3.1.0
 - 3.2.1
 - 3.2.8
 - 3.2.13
 - 4.0.2 (0)
 - 4.1.8 (0)
 - 4.2.1 (0)
 - 4.2.7 (0)
 - 4.2.9 (0)
 - 5.0.0.1 (0)
 - 5.1.7 (0)
 - 5.2.3 (0)
 - 6.0.0 (0)
 - 6.1.3.1 (0)
 - 6.1.7.7 (0)
 - 7.0.0
 - 7.1.3.2 (2)
 - 7.1.3.4 (0)
 - What's this?
 
dup
  public
  Duped objects have no id assigned and are treated as new records. Note that this is a “shallow” copy as it copies the object’s attributes only, not its associations. The extent of a “deep” copy is application specific and is therefore left to the application to implement according to its need. The dup method does not preserve the timestamps (created|updated)_(at|on).
  
    
      Register or 
      log in
      to add new notes.
  
  
  
  
      
    
 leods92 -  
    April  1, 2015 - (>= v4.1.8)
    
  
  
  
       
  
  
  
          
    
    0 thanks
     
  
  
  Parent associations are kept
Maybe this information will save you some time: parent associations (i.e. associations with foreign id in current record) are copied. Don’t assume you’ll get a safely editable object.

  
  
  
    