Skip to content

Instantly share code, notes, and snippets.

@sue445
Created June 18, 2014 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sue445/2c6d0d7ddce9fdb64632 to your computer and use it in GitHub Desktop.
Save sue445/2c6d0d7ddce9fdb64632 to your computer and use it in GitHub Desktop.
Auto annotate on Padrino
=begin
# Add to Raketask after PadrinoTasks.init
require "padrino-core"
if Padrino.env == :development
Rake::Task['ar:migrate'].enhance do
Rake::Task['annotate'].invoke
end
Rake::Task['ar:rollback'].enhance do
Rake::Task['annotate'].invoke
end
end
=end
desc "annotate models"
task :annotate => :environment do
require 'annotate/annotate_models'
AnnotateModels.do_annotations(
model_dir: "#{__dir__}/../../models/",
exclude_fixtures: true,
exclude_factories: true,
exclude_tests: true,
show_indexes: true,
format_markdown: false
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment