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

Version Path
pulitzer-0.10.1 app/models/pulitzer/free_form_section.rb
pulitzer-0.10.0 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.14 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.13 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.11 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.10 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.9 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.8 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.7 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.6 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.5 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.4 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.3 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.2 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.1 app/models/pulitzer/free_form_section.rb
pulitzer-0.5.0 app/models/pulitzer/free_form_section.rb
pulitzer-0.4.16 app/models/pulitzer/free_form_section.rb
pulitzer-0.4.15 app/models/pulitzer/free_form_section.rb
pulitzer-0.4.14 app/models/pulitzer/free_form_section.rb
pulitzer-0.4.13 app/models/pulitzer/free_form_section.rb