Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created April 3, 2019 14:21
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 krisleech/4c33d09a1b9d3d690a9bffec832049b9 to your computer and use it in GitHub Desktop.
Save krisleech/4c33d09a1b9d3d690a9bffec832049b9 to your computer and use it in GitHub Desktop.
inline ActiveRecord and Bundler
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activerecord"
gem "sqlite3"
end
require "active_record"
require "logger"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :fruits, force: true do |t|
end
end
class Fruit < ActiveRecord::Base
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment