This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb | |
index 725f4cd..a1eda0e 100644 | |
--- a/railties/guides/rails_guides.rb | |
+++ b/railties/guides/rails_guides.rb | |
@@ -1,17 +1,22 @@ | |
-pwd = File.dirname(__FILE__) | |
-$: << pwd | |
-$: << File.join(pwd, "../../activesupport/lib") | |
-$: << File.join(pwd, "../../actionpack/lib") | |
+$: << File.dirname(__FILE__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AssertionExtensions | |
def method_missing(method_id, *arguments, &block) | |
return super unless method_id.to_s =~ /^assert_(not_)?(.*)$/ | |
method = "#{$2}?" | |
object = arguments.first | |
if $1 | |
arguments.each do |object| | |
assert ! object.send(method), "#{method} is not false for #{object}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: intern.h | |
=================================================================== | |
--- intern.h (revision 22918) | |
+++ intern.h (working copy) | |
@@ -268,6 +268,15 @@ | |
VALUE rb_gc_enable _((void)); | |
VALUE rb_gc_disable _((void)); | |
VALUE rb_gc_start _((void)); | |
+VALUE rb_gc_enable_stats _((void)); | |
+VALUE rb_gc_disable_stats _((void)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit ed20f4dcc656ac55adbe9515466ef19d102e9ead | |
Author: Pratik Naik <[email protected]> | |
Date: Thu Mar 5 22:45:04 2009 +0000 | |
should_be_fucking_restful | |
diff --git a/lib/shoulda/action_controller.rb b/lib/shoulda/action_controller.rb | |
index 4719851..3723c72 100644 | |
--- a/lib/shoulda/action_controller.rb | |
+++ b/lib/shoulda/action_controller.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | |
index 97c6cd4..b99c2c6 100644 | |
--- a/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | |
+++ b/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | |
@@ -147,6 +147,25 @@ module ActiveRecord | |
execute "INSERT INTO #{quote_table_name(table_name)} (#{fixture.key_list}) VALUES (#{fixture.value_list})", 'Fixture Insert' | |
end | |
+ def insert_many_fixtures(fixtures, table_name) | |
+ columns = self.columns(table_name, "#{table_name} Columns") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test.rb | |
# require 'report_test_error_asap.rb' | |
# lib/report_test_error_asap.rb | |
require 'test/unit' | |
require 'test/unit/ui/console/testrunner' | |
class Test::Unit::UI::Console::TestRunner | |
def add_fault(fault) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
# establish_connection :main_database | |
end | |
class Book < ActiveRecord::Base | |
establish_connection :second_database | |
end | |
ActiveRecord::Base.with_connection do | |
Book.do_some_shit! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RailsHelpers | |
def form_for(object) | |
is_record_new = api_hook_record_new(object) | |
end | |
private | |
def api_hook_record_new(object) | |
# option 1 : raise "Should be overridden by ORM" | |
# option 2 : object.new_record? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class Callbacks | |
def initialize(&block) | |
@before = [] | |
@after = [] | |
instance_eval(&block) if block_given? | |
end | |
def before(middleware, *args, &block) | |
if block_given? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class Callbacks < ::Array | |
DUMMY_APP = proc {|env| } | |
def initialize(app, &block) | |
@app = app | |
instance_eval(&block) if block_given? | |
end | |
def use(middleware, *args, &block) |