Skip to content

v2.6.6---Rails4.2 Nothing to annotate #235

Closed
@DevinHe

Description

@DevinHe

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/models

v2.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions