Skip to content

Instantly share code, notes, and snippets.

View adelcambre's full-sized avatar

Andy Delcambre adelcambre

View GitHub Profile
def published=(binary_string)
# We need this because the values get populated from the params
attribute_set(:published, binary_string == "1")
end
Merb::Router.prepare do
# I don't like the name :condition for this
resources :users, :condition => /.*/ do
resources :comments
end
# match("/users/:id", :id => /.*/)
# match("/users/:user_id/comments", :user_id => /.*/)
end
andy@hiro:...merb/merb-more% cat merb-gen/lib/generators/templates/application/common/dothtaccess sprint
# Sets the default handler for FastCGI scripts
AddHandler fastcgi-script .fcgi
# If Apache2 is used together with mod_fcgid,
# uncomment the line below and comment in the line
# above to set the correct script handler
#AddHandler fcgid-script .fcgi
RewriteEngine On
options.scan(/(\w+)=(\w+)/).inject({}) { |h,(k,v)| h[k] = v; h }
commit ed47134b48efffcf717fb5afbcb918e51a305e54
Author: Matt Aimonetti <mattaimonetti@gmail.com>
Date: Thu Oct 16 19:09:47 2008 -0700
Fix: merb-helpers - Radio groups should only have one element with the checked property - Ticket #271
aczid fixed the problem by only setting the radio button as true if it has a value
diff --git a/merb-helpers/lib/merb-helpers/form/builder.rb b/merb-helpers/lib/merb-helpers/form/builder.rb
index 53b7ca9..96a463e 100644
loop
begin
code_that_might_raise
rescue
count ||= 0; count +=1
break if count > 10
end
end
~/ey_projs/awsm(migration) $ MERB_ENV=development bin/rake db:migrate
(in /Users/pbiegaj/ey_projs/awsm)
Loading init file from /Users/pbiegaj/ey_projs/awsm/config/init.rb
Loading /Users/pbiegaj/ey_projs/awsm/config/environments/development.rb
Loading init file from /Users/pbiegaj/ey_projs/awsm/config/init.rb
/Users/pbiegaj/ey_projs/awsm/config/init.rb:30: warning: already initialized constant SSH_KEY_FILE
Loading /Users/pbiegaj/ey_projs/awsm/config/environments/development.rb
~ Connecting to database...
~ Loaded slice 'MerbAuthSlicePassword' ...
~ Parent pid: 1412
mysql> XA START "asdf";
Query OK, 0 rows affected (0.00 sec)
mysql> create table asdf2 (id integer);
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
diff --git a/spec/mysql_server_spec.rb b/spec/mysql_server_spec.rb
index dcb8a4c..7637c23 100644
--- a/spec/mysql_server_spec.rb
+++ b/spec/mysql_server_spec.rb
@@ -1,4 +1,5 @@
MOUNT_POINT = File.expand_path(File.dirname(__FILE__) + '/../mount')
+require File.dirname(__FILE__) + '/spec_helper'
require 'fileutils'
describe "A mysql server" do
# Wtf? If you aren't multithreaded, Thread.current == Thread.mainm
# why on earth would you ever want to turn this off? oh, and it defaults off
def request_info(request, parser) #:nodoc:
thread = @params[:multi_thread] ? Thread.current : Thread.main
thread[:ec2_connection] ||= Rightscale::HttpConnection.new(:exception => AwsError, :logger => @logger)
request_info_impl(thread[:ec2_connection], @@bench, request, parser)
end