Sha256: af243cdb5adef8a9f2e119de8b06ab6fe700e4ea5efe37b9257b38c03b03dbd3
Contents?: true
Size: 531 Bytes
Versions: 31
Compression:
Stored size: 531 Bytes
Contents
module Pulitzer class FreeFormSection < ActiveRecord::Base belongs_to :version belongs_to :free_form_section_type has_many :partials, -> { order :sort_order} def clone_me clone_attrs = self.attributes.dup clone_attrs.delete 'id' clone_attrs.delete 'version_id' my_clone = Pulitzer::FreeFormSection.create!(clone_attrs) partials.each do |partial| cloned_partial = partial.clone_me my_clone.partials << cloned_partial end my_clone end end end
Version data entries
31 entries across 31 versions & 1 rubygems