aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/install.rake
blob: 598e30c2d4b6060902b151a30c319c7b48438c7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

namespace :action_mailbox do
  # Prevent migration installation task from showing up twice.
  Rake::Task["install:migrations"].clear_comments

  desc "Copy over the migration"
  task install: %w[ environment run_generator copy_migrations ]

  task :run_generator do
    system "#{RbConfig.ruby} ./bin/rails generate mailbox application --no-test-framework"
  end

  task :copy_migrations do
    Rake::Task["active_storage:install:migrations"].invoke
    Rake::Task["railties:install:migrations"].reenable # Otherwise you can't run 2 migration copy tasks in one invocation
    Rake::Task["action_mailbox:install:migrations"].invoke
  end
end