Skip to content

Instantly share code, notes, and snippets.

@michaeldever
Created December 5, 2017 13:04
Show Gist options
  • Save michaeldever/85631b0a66ecae341556f9a1a838e73a to your computer and use it in GitHub Desktop.
Save michaeldever/85631b0a66ecae341556f9a1a838e73a to your computer and use it in GitHub Desktop.
ActiveRecord Connection
Daemons.run_proc(options) do
begin
# NOTE: Ensure we have a database connection
defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection
rescue StandardError => e
puts e.message
puts e.backtrace
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment