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

Version Path
rubypitaya-3.19.6 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.5 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.4 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.3 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.19.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.18.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.17.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.17.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.17.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.16.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.15.3 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.15.2 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.15.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.15.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.14.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.13.1 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.13.0 ./lib/rubypitaya/core/helpers/setup_helper.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/core/helpers/setup_helper.rb