Sha256: 4c913f0941b0ed5ec63a3085929e573b4dd9c3e938b009fb624408fcb92a3d6d

Contents?: true

Size: 1.4 KB

Versions: 29

Compression:

Stored size: 1.4 KB

Contents

require 'active_record'

require 'rubypitaya/core/database_config'

# Database connection
database_config = RubyPitaya::DatabaseConfig.new
ActiveRecord::Base.establish_connection(database_config.connection_data)
# ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
# ActiveSupport::LogSubscriber.colorize_logging = true

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

29 entries across 29 versions & 1 rubygems

Version Path
rubypitaya-3.5.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.4.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.4.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.4.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.7 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.6 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.5 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.4 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.3 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.3.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.2.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.1.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.1.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.0.3 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.0.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.0.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.0.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-2.27.1 ./lib/rubypitaya/core/helpers/setup_helper.rb