Skip to content

Instantly share code, notes, and snippets.

@vitaly-pushkar
Created January 23, 2020 20:04
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 vitaly-pushkar/d668b255c7564acb6fc18f74a7de7218 to your computer and use it in GitHub Desktop.
Save vitaly-pushkar/d668b255c7564acb6fc18f74a7de7218 to your computer and use it in GitHub Desktop.
From the blog post "Error Handling with Either Monads in Ruby"
ActiveRecord::Base.establish_connection( adapter: 'sqlite3', database: ":memory:" )
ActiveRecord::Schema.define(version: 1) { create_table(:users) { |t| t.string :name; t.string :email } }
class User < ActiveRecord::Base; end
User.create(name: 'Vitaly', email: 'vitaly.pushkar@gmail.com')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment