Closed
Description
When i used annotate_models gem in my Rails4.2 project(Ruby-v2.1.2), it works wrong.Then i found some differences between version 2.6.5(tested in Rails4.1.4 and Ruby-v1.9.3 project) and version 2.6.6.
#../annotate.rb
def self.setup_options(options = {})
#...
puts "model_dir-------------------------#{options[:model_dir]}"
if(!options[:model_dir])
options[:model_dir] = ['app/models']
end
puts "model_dir-------------------------#{options[:model_dir]}"
return options
end
Print Results:
v2.6.5
model_dir-------------------------
model_dir-------------------------app/modelsv2.6.6
model_dir-------------------------[]
model_dir-------------------------[]
When i modified the code,it works well again:
# v2.6.6
def self.setup_options(options = {})
#...
if(options[:model_dir].empty?)
options[:model_dir] = ['app/models']
end
return options
end
Print:
model_dir-------------------------[]
model_dir-------------------------["app/models"]
I am not sure about this issue,it's a bug or not.