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
(defun cabbage-ruby-test-run-file (filename) | |
(interactive (list(buffer-file-name))) | |
(let* ((name-buffer "ruby-test") | |
(name-buffer-full (format "*%s*" name-buffer))) | |
(display-buffer (get-buffer-create name-buffer-full)) | |
(with-current-buffer name-buffer-full | |
(erase-buffer)) | |
(display-buffer name-buffer-full) | |
(ruby-compilation-do name-buffer (cons "ruby" (list filename))))) |
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
[33m2fcef66[m[32m (HEAD, master)[m explain how to contribute to the documentation. [31m[Yves Senn][m [36m[14 seconds ago][m | |
diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md | |
index f95a194..a035279 100644 | |
--- a/guides/source/contributing_to_ruby_on_rails.md | |
+++ b/guides/source/contributing_to_ruby_on_rails.md | |
@@ -184,7 +184,11 @@ Ruby on Rails has two main sets of documentation: the guides help you in learnin | |
You can help improve the Rails guides by making them more coherent, consistent or readable, adding missing information, correcting factual errors, fixing typos, or bringing it up to date with the latest edge Rails. To get involved in the translation of Rails guides, please see [Translating Rails Guides](https://wiki.github.com/rails/docrails/translating-rails-guides). | |
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 QC | |
module Rails | |
class Job < ActiveRecord::Base | |
self.table_name = "queue_classic_jobs" | |
end | |
class Conn < QC::Conn | |
attr_reader :ar_conn | |
def initialize(ar_conn) | |
@ar_conn = ar_conn |
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
def test_example | |
e = Hstore.new tags: {"bool" => true, "number" => 5} | |
e.tags # => {"bool" => true, "number" => 5} | |
e.save | |
e.reload.tags # => {"bool" => "true", "number" => "5"} | |
end |
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 |
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
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
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
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
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' | |