Skip to content

Instantly share code, notes, and snippets.

View eostrom's full-sized avatar
💭
Reacting

Erik Ostrom eostrom

💭
Reacting
View GitHub Profile
@eostrom
eostrom / merge-join-test.rb
Created May 18, 2018 13:33
Rails 5.2 reciprocal joins/merge test case
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
@eostrom
eostrom / gist:5771076
Last active December 18, 2015 10:49 — forked from rafaelss/gist:3700977
Steps to upgrade from PostgreSQL 9.1.5 to 9.2.4 using Homebrew (Mac OS X)
if you're using `launchd` to manage PostgreSQL
and your superuser is named `postgres`.
1. pg_dumpall -U postgres > postgres-9.1.5-dumpall
2. launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
3. mv /usr/local/var/postgres /usr/local/var/postgres91
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8 -U postgres
6. launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@eostrom
eostrom / gist:4410054
Last active December 10, 2015 08:48 — forked from anonymous/gist:4410050
Another way to simplify Disqus comments (cf http://www.mwdesilva.com/posts/65-let-s-disqus).
class DisqusablePresenter < Struct.new(:subject)
def disqus_id
dom_id(subject)
end
def to_s
# You'd probably need to include something to make the `render` helper available here.
render :partial => 'disqusable/disqus_thread', :locals => {:subject => self}
end
end
[556] activerecord (2-3-stable) $ rake test_mysql
rake test_mysql
(in /Users/eostrom/workspace/rails/activerecord)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test:test/connections/native_mysql" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/aaa_create_tables_test.rb" "test/cases/active_schema_test_mysql.rb" "test/cases/adapter_test.rb" "test/cases/aggregations_test.rb" "test/cases/ar_schema_test.rb" "test/cases/associations/belongs_to_associations_test.rb" "test/cases/associations/callbacks_test.rb" "test/cases/associations/cascaded_eager_loading_test.rb" "test/cases/associations/eager_load_includes_full_sti_class_test.rb" "test/cases/associations/eager_load_nested_include_test.rb" "test/cases/associations/eager_singularization_test.rb" "test/cases/associations/eager_test.rb" "test/cases/associations/extension_test.rb" "test/cases/associations/has_and_belongs_to_many_associations_test.rb" "test/cases/associations/has_many_associations_test.rb"