Class: Pageflow::EntryDuplicate

Inherits:
Struct
  • Object
show all
Defined in:
app/models/pageflow/entry_duplicate.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#original_entryObject

Returns the value of attribute original_entry

Returns:

  • (Object)

    the current value of original_entry



2
3
4
# File 'app/models/pageflow/entry_duplicate.rb', line 2

def original_entry
  @original_entry
end

Class Method Details

.of(entry) ⇒ Object



15
16
17
# File 'app/models/pageflow/entry_duplicate.rb', line 15

def self.of(entry)
  new(entry)
end

Instance Method Details

#create!Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/models/pageflow/entry_duplicate.rb', line 3

def create!
  ActiveRecord::Base.transaction do
    create_entry

    copy_permalink
    copy_draft
    copy_memberships
  end

  new_entry
end