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
draw do | |
get 'get/first', 'get/second', 'get/third', :to => 'get#show' | |
end | |
get '/get/first' | |
assert_equal 'get#show', @response.body | |
get '/get/second' | |
assert_equal 'get#show', @response.body |
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
irb(main):005:0> class Example | |
irb(main):006:1> this_method_does_not_exist | |
irb(main):007:1> end | |
NameError: undefined local variable or method `this_method_does_not_exist' for Example:Class | |
from (irb):6:in `<class:Example>' | |
from (irb):5 | |
from /Users/senny/.rbenv/versions/1.9.3-p385/bin/irb:12:in `<main>' | |
irb(main):008:0> Example | |
=> Example |
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
-if defined?(Bundler) | |
- # If you precompile assets before deploying to production, use this line | |
- Bundler.require *Rails.groups(:assets => %w(development test)) | |
- # If you want your assets lazily compiled in production, use this line | |
- # Bundler.require(:default, :assets, Rails.env) | |
-end | |
+# If you precompile assets before deploying to production, use this line | |
+Bundler.require *Rails.groups(:assets => %w(development test)) | |
+# If you want your assets lazily compiled in production, use this line | |
+# Bundler.require(:default, :assets, Rails.env) |
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
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do | |
create_table :posts do |t| |
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/Gemfile b/Gemfile | |
index 9a2ccae..e210472 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -1,6 +1,6 @@ | |
source 'https://rubygems.org' | |
-gem 'rails', '3.2.13' | |
+gem 'rails', '4.0.0.rc1' | |
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
require 'logger' | |
require 'active_record' | |
ActiveRecord::Base.logger = Logger.new(STDERR) | |
ActiveRecord::Base.establish_connection( | |
adapter: "sqlite3", | |
database: ":memory:" | |
) | |
ActiveRecord::Schema.define do |
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
from plone.dexterity.utils import createContentInContainer | |
from plone.namedfile.file import NamedBlobFile | |
import transaction | |
def Builder(name): | |
if name == "dossier": | |
return DossierBuilder(BuilderSession.instance()) | |
elif name == "document": | |
return DocumentBuilder(BuilderSession.instance()) | |
elif name == "task": |
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 EncodingBug | |
end | |
filename = ARGV[0] | |
puts "using encoding: #{filename.encoding}" | |
EncodingBug.module_eval "def self.say; raise end", filename, 1 | |
begin | |
EncodingBug.say |
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/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb | |
index 9e4fa95..f26dc46 100644 | |
--- a/railties/lib/rails/generators/named_base.rb | |
+++ b/railties/lib/rails/generators/named_base.rb | |
@@ -14,7 +14,6 @@ module Rails | |
# Unfreeze name in case it's given as a frozen string | |
args[0] = args[0].dup if args[0].is_a?(String) && args[0].frozen? | |
super | |
- self.name = options[:model_name] if options[:model_name] | |
assign_names!(self.name) |
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
activerecord » ARCONN=mysql2 ruby -Itest test/cases/adapters/mysql2/quoting_test.rb | |
Using mysql2 with Identity Map off | |
Run options: | |
# Running tests: | |
[1/2] ActiveRecord::ConnectionAdapters::Mysql2Adapter::QuotingTest#test_type_cast_false = 0.00 s | |
1) Failure: | |
test_type_cast_false(ActiveRecord::ConnectionAdapters::Mysql2Adapter::QuotingTest) [test/cases/adapters/mysql2/quoting_test.rb:19]: | |
<0> expected but was |