Module: Nomen::Migrator

Defined in:
lib/nomen/migrator.rb,
lib/nomen/migrator/model.rb,
lib/nomen/migrator/reference.rb,
lib/nomen/migrator/translation.rb

Defined Under Namespace

Classes: Model, Reference, Translation

Class Method Summary collapse

Class Method Details

.each_reflection(options = {}) ⇒ Object


5
6
7
8
9
10
11
12
13
# File 'lib/nomen/migrator.rb', line 5

def self.each_reflection(options = {})
  Ekylibre::Record::Base.descendants.each do |klass|
    klass.nomenclature_reflections.each do |_name, reflection|
      next if reflection.model.superclass != Ekylibre::Record::Base
      next if options[:nomenclature] && options[:nomenclature].to_s != reflection.nomenclature
      yield reflection
    end
  end
end