-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
28 lines (20 loc) · 788 Bytes
/
Rakefile
File metadata and controls
28 lines (20 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true
require 'dotenv/load'
# ActiveSupport autoload
require 'active_support'
require 'active_support/core_ext'
# ActiveRecord requirements
require 'erb'
require 'yaml'
require 'active_record'
$stdout.sync = true
$stderr.sync = true
config = YAML.load(ERB.new(File.read('config/database.yml')).result)
ActiveRecord::Base.establish_connection(config)
ActiveRecord::Base.connection.enable_query_cache!
ActiveRecord::Base.logger = Logger.new($stdout)
# Load models explicitly (ActiveSupport 7.x removed classic autoloader)
require File.expand_path('models/application_record', __dir__)
Dir[File.expand_path('models/*.rb', __dir__)].each { |file| require file }
Rake.add_rakelib 'lib/tasks'
I18n.load_path << Dir["#{File.expand_path('config/locales')}/*.yml"]