Sha256: 987e1a67ce3db51d8129b43e68e2953c425dfdbb2875b4bb00aad6f9bbb49778

Contents?: true

Size: 362 Bytes

Versions: 11

Compression:

Stored size: 362 Bytes

Contents

module CmPageBuilder::Rails
  class PageComponent < ApplicationRecord
    belongs_to :page

    has_one_attached :component_attachment

    default_scope { order(position: :asc) }

    def duplicate
      dupl = self.dup
      dupl.component_attachment.attach(self.component_attachment.blob) if self.component_attachment.attachment
      dupl
    end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
cm_page_builder-0.2.3 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-0.2.2 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.2.2 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.2.1 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.2.0 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.12 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.11 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.10 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.9 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.8 app/models/cm_page_builder/rails/page_component.rb
cm_page_builder-rails-0.1.7 app/models/cm_page_builder/rails/page_component.rb