We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bef0c49 commit 83cacd7Copy full SHA for 83cacd7
lib/annotate/annotate_models.rb
@@ -316,11 +316,8 @@ def get_model_class(file)
316
317
# Retrieve loaded model class by path to the file where it's supposed to be defined.
318
def get_loaded_model(model_path)
319
- ObjectSpace.each_object.
320
- select { |c|
321
- Class === c and # note: we use === to avoid a bug in activesupport 2.3.14 OptionMerger vs. is_a?
322
- c.ancestors.include?(ActiveRecord::Base)
323
- }.
+ ObjectSpace.each_object(::Class).
+ select { |c| c.ancestors.include?(ActiveRecord::Base) }.
324
detect { |c| ActiveSupport::Inflector.underscore(c) == model_path }
325
end
326
0 commit comments