Skip to content

Instantly share code, notes, and snippets.

View FooBarWidget's full-sized avatar

Hongli Lai FooBarWidget

View GitHub Profile
# Copyright (c) 2008 Phusion
# http://www.phusion.nl/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
require 'rubygems'
require 'test/unit'
require 'active_record'
module DefaultValuePlugin
class NormalValueContainer
def initialize(value)
@value = value
end
class BetaInvite < ActiveRecord::Base
default_value_for :uuid do
Utils.create_uuid
end
validates_uniqueness_of :uuid
end
ActiveRecord::SchemaDumper.class_eval do
def table(table, stream)
columns = @connection.columns(table)
begin
tbl = StringIO.new
if @connection.respond_to?(:pk_and_sequence_for)
pk, pk_seq = @connection.pk_and_sequence_for(table)
end
pk ||= 'id'
diff --git a/gc.c b/gc.c
index f4ec581..ae2a6d6 100644
--- a/gc.c
+++ b/gc.c
@@ -854,6 +854,9 @@ add_heap()
if (heap_slots <= 0) heap_slots = heap_min_slots;
while (p < pend) {
+ if (freelist == p) {
+ rb_bug("freelist == p (1)");
require 'mkmf'
$LIBS << " -pthread"
create_makefile('myext')
From c91acde4040362f545e51d7cfcf600155354a803 Mon Sep 17 00:00:00 2001
From: Hongli Lai (Phusion) <hongli@phusion.nl>
Date: Tue, 8 Jun 2010 13:22:25 +0200
Subject: [PATCH] Fix unicorn_rails compatibility with the latest Rails 3 code.
---
bin/unicorn_rails | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/bin/unicorn_rails b/bin/unicorn_rails
class Car < ActiveRecord::Base
has_many :drivers, :inverse_of => :car
end
class CreateCars < ActiveRecord::Migration
def self.up
create_table :cars do |t|
end
end