Skip to content

Commit

Permalink
Coerce class to string for comparison
Browse files Browse the repository at this point in the history
Fixes ctran#173, by ensuring that the model is coerced to a string before it's run through `ActiveSupport::Inflector.underscore`, which then correctly compares to the filename (which is a string already).
  • Loading branch information
ekampp committed Jun 11, 2014
1 parent d847673 commit 92190ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/annotate/annotate_models.rb
Expand Up @@ -399,7 +399,7 @@ def get_loaded_model(model_path)
c.ancestors.respond_to?(:include?) and # to fix FactoryGirl bug, see https://github.com/ctran/annotate_models/pull/82
c.ancestors.include?(ActiveRecord::Base)
end.
detect { |c| ActiveSupport::Inflector.underscore(c) == model_path }
detect { |c| ActiveSupport::Inflector.underscore(c.to_s) == model_path }
end
end

Expand Down

0 comments on commit 92190ef

Please sign in to comment.