Sha256: 212994cfeb39b9110d7866427a7067cc5567ae3a880948b183d8121f7418e0a3

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

require 'rails/engine'
require 'ansi'
require 'automigration/version'
require 'automigration/migrator'
require 'automigration/fields/sys/base'
require 'automigration/fields/belongs_to'
require 'automigration/fields/boolean'
require 'automigration/fields/date'
require 'automigration/fields/datetime'
require 'automigration/fields/float'
require 'automigration/fields/integer'
require 'automigration/fields/password'
require 'automigration/fields/string'
require 'automigration/fields/text'
require 'automigration/fields/time'
require 'automigration/fields/sys/db_column'
require 'automigration/fields/sys/keeper'
require 'automigration/fields/sys/slice_creater'

module Automigration
  class Engine < ::Rails::Engine
    config.automigration = ActiveSupport::OrderedOptions.new
    config.automigration.system_tables = []
    config.automigration.models_load_path = []
    config.automigration.models_to_ignore = []
    config.automigration.migrations_path = nil

    initializer 'automigration' do |app|
      app.config.automigration.models_load_path << Rails.root + 'app/models'
      app.config.automigration.migrations_path = Rails.root + 'db/migrate'

      ActiveSupport.on_load(:active_record) do
        require 'automigration/base_extention'
      end

      Migrator.set_models_load_path(app.config.automigration.models_load_path)
      Migrator.set_models_to_ignore(app.config.automigration.models_to_ignore)
      Migrator.set_system_tables(app.config.automigration.system_tables)
      Migrator.set_migrations_path(app.config.automigration.migrations_path)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
automigration-0.2.2 lib/automigration.rb
automigration-0.2.1 lib/automigration.rb