lib/copyable/copyable_extension.rb in copyable-0.0.2 vs lib/copyable/copyable_extension.rb in copyable-0.1.0

- old
+ new

@@ -57,10 +57,12 @@ # already copied) CopyRegistry.register(original_model, new_model) # for this brand new model, visit all of the associated models, # making new copies according to the instructions in the copyable # declaration - Declarations::Associations.execute(main.association_list, original_model, new_model, options[:skip_validations]) + + skip_associations = options[:skip_associations] || [] + Declarations::Associations.execute(main.association_list, original_model, new_model, options[:skip_validations], skip_associations) # run the after_copy block if it exists Declarations::AfterCopy.execute(main.after_copy_block, original_model, new_model) ensure # it's critically important to re-enable the callbacks and # observers or they will stay disabled for future web