Sha256: 7e2c6a8670ba53e954c0ed88070bccd7b3ab917c2ca0758b3c1685f208465d0b
Contents?: true
Size: 1.33 KB
Versions: 36
Compression:
Stored size: 1.33 KB
Contents
require 'active_record' require 'rubypitaya/core/setup' require 'rubypitaya/core/database_config' # Database connection database_config = RubyPitaya::DatabaseConfig.new(RubyPitaya::Setup.new) ActiveRecord::Base.establish_connection(database_config.connection_data) connection_data = database_config.connection_data migrations_paths = [RubyPitaya::Path::Core::MIGRATIONS_FOLDER_PATH] migrations_paths += RubyPitaya::Path::Plugins::MIGRATIONS_FOLDER_PATHS migrations_paths += [RubyPitaya::Path::MIGRATIONS_FOLDER_PATH] ActiveRecord::Migrator.migrations_paths = migrations_paths ActiveRecord::Migration.maintain_test_schema! # Loading core files Gem.find_files('rubypitaya/**/*.rb').each do |path| require path unless path.end_with?('spec.rb') || path.include?('app/migrations') || path.include?('core/templates') || path.include?('core/spec-helpers') || path.include?('app-template') end # Loading application files app_folder_paths = RubyPitaya::Path::Plugins::APP_FOLDER_PATHS + [RubyPitaya::Path::APP_FOLDER_PATH] app_folder_paths.each do |app_folder_path| app_files_path = File.join(app_folder_path, '**/*.rb') Dir[app_files_path].each do |path| require path unless path.end_with?('spec.rb') || path.include?('app/migrations') end end
Version data entries
36 entries across 32 versions & 1 rubygems