Skip to content

Instantly share code, notes, and snippets.

View spastorino's full-sized avatar

Santiago Pastorino spastorino

View GitHub Profile
#!/usr/bin/env ruby -KU
TIMES = 100000
require 'rubygems'
gem 'addressable', '~>2.0'
gem 'faker', '~>0.3.1'
gem 'rbench', '~>0.2.3'
require 'addressable/uri'
#!/usr/bin/env ruby
require 'rubygems'
require 'sqlite3'
require 'benchmark'
require File.expand_path("../../../load_paths", __FILE__)
require 'active_record'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3',
:database => ':memory:')
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 78b3507..9fb64b5 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -961,9 +961,12 @@ module ActiveRecord #:nodoc:
attribute_names = match.attribute_names
super unless all_attributes_exists?(attribute_names)
if match.finder?
- options = arguments.extract_options!
- relation = options.any? ? construct_finder_arel(options, current_scoped_methods) : scoped
➜ pftf git:(master) ✗ rake db:migrate --trace
(in /Users/santiago/WyeWorks/Projs/pftf)
rake aborted!
Could not find root path for Devise::Engine
/Users/santiago/.rvm/gems/rbx-1.1.0-20100923/gems/railties-3.0.1/lib/rails/engine.rb:120:in `find_root_with_flag'
/Users/santiago/.rvm/gems/rbx-1.1.0-20100923/gems/railties-3.0.1/lib/rails/engine/configurable.rb:12:in `config'
/Users/santiago/.rvm/gems/rbx-1.1.0-20100923/bundler/gems/devise-cdbd03c45a5b/lib/devise/rails.rb:6:in `__class_init__ (Engine)'
/Users/santiago/.rvm/gems/rbx-1.1.0-20100923/bundler/gems/devise-cdbd03c45a5b/lib/devise/rails.rb:5:in `__module_init__ (Devise)'
/Users/santiago/.rvm/gems/rbx-1.1.0-20100923/bundler/gems/devise-cdbd03c45a5b/lib/devise/rails.rb:4:in `__script__'
kernel/common/codeloader.rb:145:in `require'
➜ rails git:(master) ✗ bundle update
Updating git://github.com/rails/arel.git
Updating git://github.com/rack/rack.git
Fetching source index for http://rubygems.org/
/Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:235:in `resolve': undefined method `name' for nil:NilClass (NoMethodError)
from /Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:216:in `resolve'
from /Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:344:in `resolve_requirement'
from /Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:343:in `catch'
from /Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:343:in `resolve_requirement'
from /Users/santiago/.rvm/gems/ruby-1.8.7-p302@global/gems/bundler-1.0.2/lib/bundler/resolver.rb:295:in `resolve'
➜ rails git:(spastorino-master) bundle update
...
Installing mysql (2.8.1) with native extensions An exception occurred running /Users/santiago/.rvm/gems/rbx-head@global/bin/bundle
ERROR: Failed to build gem native extension.
/Users/santiago/.rvm/rubies/rbx-head/bin/rbx extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h...
➜ rails git:(spastorino-master) rake
(in /Users/santiago/WyeWorks/Projs/rails)
(in /Users/santiago/WyeWorks/Projs/rails/activesupport)
/Users/santiago/.rvm/rubies/rbx-head/bin/rbx -w -I"lib:test" "/Users/santiago/.rvm/gems/rbx-head/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/benchmarkable_test.rb" "test/buffered_logger_test.rb" "test/caching_test.rb" "test/callback_inheritance_test.rb" "test/callbacks_test.rb" "test/clean_backtrace_test.rb" "test/clean_logger_test.rb" "test/concern_test.rb" "test/configurable_test.rb" "test/dependencies_test.rb" "test/deprecation_test.rb" "test/descendants_tracker_test.rb" "test/file_update_checker_test.rb" "test/flush_cache_on_private_memoization_test.rb" "test/gzip_test.rb" "test/i18n_test.rb" "test/inflector_test.rb" "test/isolation_test.rb" "test/lazy_load_hooks_test.rb" "test/load_paths_test.rb" "test/log_subscriber_test.rb" "test/memoizable_test.rb" "test/message_encryptor_test.rb" "test/message_verifier_test.rb" "test/multibyte_chars_test.rb" "test/multib
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb
index d1c8064..5250807 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -51,14 +51,9 @@ module ActionView
begin
Float(number)
- is_number_html_safe = true
rescue ArgumentError, TypeError
require 'fiber'
module Eigenclass
def eigenclass
class << self; self end
end
module_function :eigenclass
public :eigenclass
end
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index 65434fb..829299a 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -224,9 +224,9 @@ module ActiveRecord
# # creates avatar_attributes= and posts_attributes=
# accepts_nested_attributes_for :avatar, :posts, :allow_destroy => true
def accepts_nested_attributes_for(*attr_names)
- options = { :allow_destroy => false, :update_only => false }
+ options = { :allow_destroy => false, :update_only => false, :partial_updates => false }