Skip to content

Try "app:" task prefix on migration annotaiton #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/tasks/annotate_models_migrate.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
%w(db:migrate db:migrate:up db:migrate:down db:migrate:reset db:migrate:redo db:rollback).each do |task|
Rake::Task[task].enhance do
Rake::Task[Rake.application.top_level_tasks.last].enhance do
Rake::Task['set_annotation_options'].invoke
annotation_options_task = if Rake::Task.task_defined?('app:set_annotation_options')
'app:set_annotation_options'
else
'set_annotation_options'
end
Rake::Task[annotation_options_task].invoke
Annotate::Migration.update_annotations
end
end
Expand Down Expand Up @@ -37,6 +42,8 @@ module Annotate
def self.update_routes
if Rake::Task.task_defined?("annotate_routes")
Rake::Task["annotate_routes"].invoke
elsif Rake::Task.task_defined?("app:annotate_routes")
Rake::Task["app:annotate_routes"].invoke
end
end
end
Expand Down