Commit d9623df7 by Cuong Tran

Merge pull request #297 from mintuhouse/bug_ignore_columns

Fix: Ignore columns not respected when the rake task is invoked
parents 6fd2fb67 eb4d75b6
...@@ -143,7 +143,7 @@ module AnnotateModels ...@@ -143,7 +143,7 @@ module AnnotateModels
info<< "# #{ '-' * ( max_size + md_names_overhead ) } | #{'-' * md_type_allowance} | #{ '-' * 27 }\n" info<< "# #{ '-' * ( max_size + md_names_overhead ) } | #{'-' * md_type_allowance} | #{ '-' * 27 }\n"
end end
cols = klass.columns cols = klass.columns.dup
if options[:ignore_columns] if options[:ignore_columns]
cols.reject! { |col| col.name.match(/#{options[:ignore_columns]}/) } cols.reject! { |col| col.name.match(/#{options[:ignore_columns]}/) }
end end
......
...@@ -38,6 +38,7 @@ task :annotate_models => :environment do ...@@ -38,6 +38,7 @@ task :annotate_models => :environment do
options[:trace] = Annotate.true?(ENV['trace']) options[:trace] = Annotate.true?(ENV['trace'])
options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper']) options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper'])
options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper']) options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper'])
options[:ignore_columns] = ENV['ignore_columns']
AnnotateModels.do_annotations(options) AnnotateModels.do_annotations(options)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment