Skip to content

Commit 9cf6e0d

Browse files
committed
Merge pull request #283 from kamilbielawski/accept-wrapper-default-params
Accept wrapper default params
2 parents 2e555f0 + 2c01787 commit 9cf6e0d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/annotate.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Annotate
2929
:timestamp, :exclude_serializers, :classified_sort, :show_foreign_keys,
3030
]
3131
OTHER_OPTIONS=[
32-
:ignore_columns, :skip_on_db_migrate
32+
:ignore_columns, :skip_on_db_migrate, :wrapper_open, :wrapper_close
3333
]
3434
PATH_OPTIONS=[
3535
:require, :model_dir
@@ -78,6 +78,12 @@ def self.setup_options(options = {})
7878
return options
7979
end
8080

81+
def self.reset_options
82+
[POSITION_OPTIONS, FLAG_OPTIONS, PATH_OPTIONS, OTHER_OPTIONS].flatten.each do |key|
83+
ENV[key.to_s] = nil
84+
end
85+
end
86+
8187
def self.skip_on_migration?
8288
ENV['skip_on_db_migrate'] =~ TRUE_RE
8389
end

lib/generators/annotate/templates/auto_annotate_models.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ if Rails.env.development?
3030
'sort' => "false",
3131
'force' => "false",
3232
'trace' => "false",
33+
'wrapper_open' => nil,
34+
'wrapper_close' => nil,
3335
})
3436
end
3537

spec/annotate/annotate_models_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ class User < ActiveRecord::Base
479479
mock_column(:name, :string, :limit => 50)
480480
])
481481
@schema_info = AnnotateModels.get_schema_info(@klass, "== Schema Info")
482+
Annotate.reset_options
482483
end
483484

484485
def write_model file_name, file_content

0 commit comments

Comments
 (0)