Commit 92190ef1 by Emil Kampp

Coerce class to string for comparison

Fixes ctran/annotate_models#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).
parent d8476735
...@@ -399,7 +399,7 @@ module AnnotateModels ...@@ -399,7 +399,7 @@ module AnnotateModels
c.ancestors.respond_to?(:include?) and # to fix FactoryGirl bug, see https://github.com/ctran/annotate_models/pull/82 c.ancestors.respond_to?(:include?) and # to fix FactoryGirl bug, see https://github.com/ctran/annotate_models/pull/82
c.ancestors.include?(ActiveRecord::Base) c.ancestors.include?(ActiveRecord::Base)
end. end.
detect { |c| ActiveSupport::Inflector.underscore(c) == model_path } detect { |c| ActiveSupport::Inflector.underscore(c.to_s) == model_path }
end end
end end
......
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