Commit 9cf6e0d0 by Cuong Tran

Merge pull request #283 from kamilbielawski/accept-wrapper-default-params

Accept wrapper default params
parents 2e555f05 2c01787d
...@@ -29,7 +29,7 @@ module Annotate ...@@ -29,7 +29,7 @@ module Annotate
:timestamp, :exclude_serializers, :classified_sort, :show_foreign_keys, :timestamp, :exclude_serializers, :classified_sort, :show_foreign_keys,
] ]
OTHER_OPTIONS=[ OTHER_OPTIONS=[
:ignore_columns, :skip_on_db_migrate :ignore_columns, :skip_on_db_migrate, :wrapper_open, :wrapper_close
] ]
PATH_OPTIONS=[ PATH_OPTIONS=[
:require, :model_dir :require, :model_dir
...@@ -78,6 +78,12 @@ module Annotate ...@@ -78,6 +78,12 @@ module Annotate
return options return options
end end
def self.reset_options
[POSITION_OPTIONS, FLAG_OPTIONS, PATH_OPTIONS, OTHER_OPTIONS].flatten.each do |key|
ENV[key.to_s] = nil
end
end
def self.skip_on_migration? def self.skip_on_migration?
ENV['skip_on_db_migrate'] =~ TRUE_RE ENV['skip_on_db_migrate'] =~ TRUE_RE
end end
......
...@@ -30,6 +30,8 @@ if Rails.env.development? ...@@ -30,6 +30,8 @@ if Rails.env.development?
'sort' => "false", 'sort' => "false",
'force' => "false", 'force' => "false",
'trace' => "false", 'trace' => "false",
'wrapper_open' => nil,
'wrapper_close' => nil,
}) })
end end
......
...@@ -479,6 +479,7 @@ end ...@@ -479,6 +479,7 @@ end
mock_column(:name, :string, :limit => 50) mock_column(:name, :string, :limit => 50)
]) ])
@schema_info = AnnotateModels.get_schema_info(@klass, "== Schema Info") @schema_info = AnnotateModels.get_schema_info(@klass, "== Schema Info")
Annotate.reset_options
end end
def write_model file_name, file_content def write_model file_name, file_content
......
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