Class: ActiveRecord::Snapshot::Import

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/snapshot/actions/import.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version: nil, tables: []) ⇒ Import

Returns a new instance of Import.



8
9
10
11
12
13
14
15
16
17
# File 'lib/active_record/snapshot/actions/import.rb', line 8

def initialize(version: nil, tables: [])
  @version = version
  if named_version?
    name = version
  else
    @version, name = SelectSnapshot.call(version)
  end
  @snapshot = Snapshot.new(name)
  @tables = tables
end

Class Method Details

.call(*args) ⇒ Object



4
5
6
# File 'lib/active_record/snapshot/actions/import.rb', line 4

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



19
20
21
# File 'lib/active_record/snapshot/actions/import.rb', line 19

def call
  Stepper.call(self, **steps)
end