Skip to content

Instantly share code, notes, and snippets.

@dsasse07
Created January 10, 2021 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsasse07/d3b84beba40ad2c809432a439c4532b2 to your computer and use it in GitHub Desktop.
Save dsasse07/d3b84beba40ad2c809432a439c4532b2 to your computer and use it in GitHub Desktop.
Environment file for SubscriptionTracker loading the module files in heirarchy order before loading the model files
require 'bundler'
Bundler.require
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: 'db/development.db')
ActiveRecord::Base.logger = nil
require_relative '../app/tools/funstuff.rb' #=> Begin loading files from the bottom of the heirarchy
require_relative '../app/tools/cli_controls.rb' #=> Step 2 on the heirarchy
require_relative '../app/tools/icalendar.rb' #=> The order of these four files is not important
require_relative '../app/tools/login_control.rb' #=> since none of these inherit each other
require_relative '../app/tools/new_subscription_control.rb'
require_relative '../app/tools/update_subscription_handler.rb'
require_relative '../app/tools/spending_analyzer.rb' #=> These three files must come last
require_relative '../app/tools/access_subscriptions.rb' #=> but their specific order is not important
require_relative '../app/tools/user_settings.rb' #=> since they do not inherit each other
require_all 'app' #=> requires the remaining model files and the main app file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment