Class: DatabaseClonerRails::Uploader

Inherits:
Object
  • Object
show all
Defined in:
lib/database_cloner_rails/uploader.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



3
4
5
# File 'lib/database_cloner_rails/uploader.rb', line 3

def self.run
  new.run
end

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/database_cloner_rails/uploader.rb', line 7

def run
  ActiveRecord::Base.connection.tables.each do |table|
    next unless table.classify.safe_constantize.present?
    begin
      require "tasks/database_cloner/db_dump/#{table}"
    rescue LoadError, StandardError => e
      puts "Oops!! #{table} could not be uploaded."
    end
  end
end