Skip to content

Commit eb4d75b

Browse files
committed
Fix: Ignore columns not respected when the rake task is invoked
1 parent 6fd2fb6 commit eb4d75b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def get_schema_info(klass, header, options = {})
143143
info<< "# #{ '-' * ( max_size + md_names_overhead ) } | #{'-' * md_type_allowance} | #{ '-' * 27 }\n"
144144
end
145145

146-
cols = klass.columns
146+
cols = klass.columns.dup
147147
if options[:ignore_columns]
148148
cols.reject! { |col| col.name.match(/#{options[:ignore_columns]}/) }
149149
end

lib/tasks/annotate_models.rake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ task :annotate_models => :environment do
3838
options[:trace] = Annotate.true?(ENV['trace'])
3939
options[:wrapper_open] = Annotate.fallback(ENV['wrapper_open'], ENV['wrapper'])
4040
options[:wrapper_close] = Annotate.fallback(ENV['wrapper_close'], ENV['wrapper'])
41+
options[:ignore_columns] = ENV['ignore_columns']
4142
AnnotateModels.do_annotations(options)
4243
end
4344

0 commit comments

Comments
 (0)