Skip to content

Instantly share code, notes, and snippets.

View spastorino's full-sized avatar

Santiago Pastorino spastorino

View GitHub Profile
$ 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'
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 || []
santiago@debian:/tmp$ gem list devise
*** LOCAL GEMS ***
santiago@debian:/tmp$ rails new myapp
create
create README
create Rakefile
create config.ru
#
# 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.
$ 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.
@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.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
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 / 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
@spastorino
spastorino / date_helper.rb
Created February 25, 2010 03:38
*_select for date_helper
module ActionView
module Helpers
module DateHelper
[:second, :minute, :hour, :day, :month, :year].each do |name|
self.module_eval(<<-EOS)
def #{name.to_s}_select(object_name, method, options = {}, html_options = {})
InstanceTag.new(object_name, method, self, options.delete(:object)).to_#{name.to_s}_select_tag(options, html_options)
end
EOS
end
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index 3977971..567ba00 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -71,15 +71,12 @@ module ActiveSupport #:nodoc:
super(ERB::Util.h(value))
end
end
+ alias << concat