lib/generators/declare_schema/migration/migrator.rb
# Returns an array of model classes and an array of table names
# that generation needs to take into account
Returns an array of model classes and an array of table names
that generation needs to take into account
Returns an array of model classes and an array of table names that generation needs to take into account
def models_and_tables
          ignore_model_names = Migrator.ignore_models.map { |model| model.to_s.underscore }
          all_models = table_model_classes
          declare_schema_models = all_models.select do |m|
            (m.name['HABTM_'] ||
              (m.include_in_migration if m.respond_to?(:include_in_migration))) && !m.name.underscore.in?(ignore_model_names)
          end
          non_declare_schema_models = all_models - declare_schema_models
          db_tables = connection.tables - Migrator.ignore_tables.map(&:to_s) - non_declare_schema_models.map(&:table_name)
          [declare_schema_models, db_tables]
        end
def models_and_tables ignore_model_names = Migrator . ignore_models . map { | model | model . to_s . underscore } all_models = table_model_classes declare_schema_models = all_models . select do | m | ( m . name [ 'HABTM_' ] || ( m . include_in_migration if m . respond_to? ( :include_in_migration ) ) ) && ! m . name . underscore . in? ( ignore_model_names ) end non_declare_schema_models = all_models - declare_schema_models db_tables = connection . tables - Migrator . ignore_tables . map ( & :to_s ) - non_declare_schema_models . map ( & :table_name ) [ declare_schema_models , db_tables ] end
Returns an array of model classes and an array of table names
that generation needs to take into account
Returns an array of model classes and an array of table names that generation needs to take into account