Class: RedmineWithGitController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/redmine_with_git_controller.rb

Instance Method Summary collapse

Instance Method Details

#exportObject



14
15
16
17
18
19
20
# File 'app/controllers/redmine_with_git_controller.rb', line 14

def export
  Tempfile.open('redmine_export') do |file|
    ::RedmineWithGit::Dump::All.new(file.path, true)
    send_file(file.path, filename: export_file_name, type: 'application/x-tar',
                         size: file.size)
  end
end

#importObject



22
23
24
25
26
27
28
29
# File 'app/controllers/redmine_with_git_controller.rb', line 22

def import
  @load = ::RedmineWithGit::Tableless::Load.new(import_params)
  @load.save
  respond_to do |format|
    format.html { import_respond_to_html }
    format.api { render_validation_errors(@load) }
  end
end

#indexObject



10
11
12
# File 'app/controllers/redmine_with_git_controller.rb', line 10

def index
  @load = ::RedmineWithGit::Tableless::Load.new
end