Skip to content

Instantly share code, notes, and snippets.

View spastorino's full-sized avatar

Santiago Pastorino spastorino

View GitHub Profile
@spastorino
spastorino / ActionController options results used in different ways
Created April 16, 2010 19:56
ActionController options results used in different ways
class ApplicationController < ActionController::Base
end
class MyController < ApplicationController
end
ActionController::Base.perform_caching = true
ActionController::Base.perform_caching # => true
ActionController::Base.new.perform_caching # => true
santiago@debian:~/Documentos/WyeWorks/Proys/rails/activesupport/lib$ ruby ../../tools/profile test_shim.rb
test_shim.rb
tzinfo
tzinfo/timezone
date
85.10 KB 2249 obj 7.1 ms rational
222.82 KB 9538 obj 35.4 ms date/format
601.21 KB 23144 obj 86.1 ms date
tzinfo/country
tzinfo/country_info
@spastorino
spastorino / Rails tests on Rubinius
Created June 24, 2010 19:40
Rails tests on Rubinius
(in /home/santiago/Documentos/WyeWorks/Proys/rails)
(in /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport)
Loaded suite /home/santiago/.rvm/gems/rbx-1.0.1-20100603/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
.................................................................................................................................................................................................................................E.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
$ bundle install
Fetching source index for http://rubygems.org/
Fetching git://github.com/rails/rails.git
remote: Counting objects: 177081, done.
remote: Compressing objects: 100% (39674/39674), done.
remote: Total 177081 (delta 136781), reused 175748 (delta 135540)
Receiving objects: 100% (177081/177081), 30.62 MiB | 59 KiB/s, done.
Resolving deltas: 100% (136781/136781), done.
Fetching git://github.com/galetahub/rails-ckeditor.git
remote: Counting objects: 3622, done.
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
santiago@debian:/tmp$ gem list devise
*** LOCAL GEMS ***
santiago@debian:/tmp$ rails new myapp
create
create README
create Rakefile
create config.ru
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index c3a34ae..14f166b 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -887,7 +887,7 @@ module ActiveRecord #:nodoc:
def scoped_methods #:nodoc:
key = :"#{self}_scoped_methods"
- Thread.current[key] = Thread.current[key].presence || self.default_scoping.dup
+ Thread.current[key] = Thread.current[key].presence || []
$ ruby -I connections/native_sqlite3/ cases/relation_scoping_test.rb
Using native SQLite3
Loaded suite cases/relation_scoping_test
Started
...........F.FFF..........FF......................
Finished in 3.008875 seconds.
1) Failure:
test_method_scope(DefaultScopingTest)
[cases/relation_scoping_test.rb:370:in `test_method_scope'
$ rake test_sqlite3
(in /home/santiago/Documents/Projs/rails/activerecord)
/usr/bin/ruby1.8 -w -I"lib:test:test/connections/native_sqlite3" "/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/adapter_test.rb" "test/cases/adapters/sqlite3/copy_table_test.rb" "test/cases/adapters/sqlite3/sqlite3_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/habtm_join_table_test.rb" "test/cases/associations/has_and_belongs_to_many_associations_test.rb" "test/cases/associations/has_many_associations_test.rb" "test/cases/asso
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 79a9d99..97dd1f8 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -317,8 +317,10 @@ module ActionView
options[:html] ||= {}
options[:html][:remote] = options.delete(:remote)
- output = form_tag(options.delete(:url) || {}, options.delete(:html) || {})
- output << fields_for(object_name, object, options, &proc)