bin/annotate in annotate-2.7.2 vs bin/annotate in annotate-2.7.3
- old
+ new
@@ -88,11 +88,11 @@
opts.on('-r', '--routes', "Annotate routes.rb with the output of 'rake routes'") do
ENV['routes'] = 'true'
end
- opts.on('-aa', '--active-admin', 'Annotate active_admin models') do
+ opts.on('-a', '--active-admin', 'Annotate active_admin models') do
ENV['active_admin'] = 'true'
end
opts.on('-v', '--version', 'Show the current version of this gem') do
puts "annotate v#{Annotate.version}"; exit
@@ -105,10 +105,16 @@
opts.on('-k', '--show-foreign-keys',
"List the table's foreign key constraints in the annotation") do
ENV['show_foreign_keys'] = 'yes'
end
+ opts.on('--ck',
+ '--complete-foreign-keys', 'Complete foreign key names in the annotation') do
+ ENV['show_foreign_keys'] = 'yes'
+ ENV['show_complete_foreign_keys'] = 'yes'
+ end
+
opts.on('-i', '--show-indexes',
"List the table's database indexes in the annotation") do
ENV['show_indexes'] = 'yes'
end
@@ -189,14 +195,18 @@
end
opts.on('--ignore-unknown-models', "don't display warnings for bad model files") do |values|
ENV['ignore_unknown_models'] = 'true'
end
+
+ opts.on('--with-comment', "include database comments in model annotations") do |values|
+ ENV['with_comment'] = 'true'
+ end
end.parse!
options = Annotate.setup_options(
is_rake: ENV['is_rake'] && !ENV['is_rake'].empty?
)
-Annotate.eager_load(options)
+Annotate.eager_load(options) if Annotate.include_models?
AnnotateModels.send(target_action, options) if Annotate.include_models?
AnnotateRoutes.send(target_action, options) if Annotate.include_routes?