Class: Memento::Action::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/memento/action/create.rb

Instance Attribute Summary

Attributes inherited from Base

#state

Instance Method Summary collapse

Methods inherited from Base

#fetch?, inherited, #initialize, #record, #record_data

Constructor Details

This class inherits a constructor from Memento::Action::Base

Instance Method Details

#fetchObject



4
# File 'lib/memento/action/create.rb', line 4

def fetch;end

#undoObject



6
7
8
9
10
11
12
13
14
# File 'lib/memento/action/create.rb', line 6

def undo
  if record.nil?
    build_fake_object
  elsif record_was_changed?
    was_changed
  else
    destroy_record
  end
end