Class: Wallaby::ActiveRecord::ModelFinder
- Inherits:
-
ModelFinder
- Object
- ModelFinder
- Wallaby::ActiveRecord::ModelFinder
- Defined in:
- lib/adapters/wallaby/active_record/model_finder.rb
Overview
Finder to return all the appropriate ActiveRecord models.
Instance Method Summary collapse
-
#all ⇒ Array<Class>
Return a list of ActiveRecord::Base subclasses that aren’t one of the following types:.
Instance Method Details
#all ⇒ Array<Class>
Return a list of ActiveRecord::Base subclasses that aren’t one of the following types:
-
abstract class
-
anonymous class
-
the HABTM relation class
13 14 15 16 17 18 19 20 21 |
# File 'lib/adapters/wallaby/active_record/model_finder.rb', line 13 def all ::ActiveRecord::Base.descendants.reject do |model_class| application_record?(model_class) || model_class.abstract_class? || anonymous?(model_class) || model_class.name.index('HABTM') || invalid_class_name?(model_class) end.sort_by(&:to_s) end |