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
-- | |
-- PostgreSQL database dump | |
-- | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
SET standard_conforming_strings = on; | |
SET check_function_bodies = false; | |
SET client_min_messages = warning; |
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
" Vim color scheme | |
" | |
" Name: railscast.vim | |
" Maintainer: Josh O'Rourke <[email protected]> | |
" License: public domain | |
" | |
" A GUI Only port of the RailsCasts TextMate theme [1] to Vim. | |
" Some parts of this theme were borrowed from the well-documented Lucius theme [2]. | |
" Ported for 256 color console vim by Felix Buenemann <[email protected]> | |
" |
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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.1.8' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
# This connection will do for database-independent bug reports. |
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/actions.go b/actions.go | |
index 93cb126..69a4235 100644 | |
--- a/actions.go | |
+++ b/actions.go | |
@@ -179,11 +179,18 @@ func sendEmail(e *EmailNotifier, doc bytes.Buffer) error { | |
} else { | |
util.Debug("Sending email to %s", e.To) | |
util.Debug("Sending email:\n%s", string(doc.Bytes())) | |
- auth := smtp.PlainAuth("", e.Username, e.Password, e.Host) | |
- err := smtp.SendMail(e.Host+":587", auth, e.From, |
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
-- strip_md(text) - strips markdown from text | |
-- (c) 2014 Felix Buenemann https://github.com/felixbuenemann | |
-- License: Public Domain | |
CREATE OR REPLACE FUNCTION strip_md(input text) RETURNS text AS $$ | |
BEGIN | |
-- strip html tags | |
input := regexp_replace(input, '<[^>]+>', '', 'g'); | |
-- strip list leaders and blockquotes | |
input := regexp_replace(input, '^([\s]*)([\*\-\+]|\d\.|>)\s+', '\1', 'ng'); | |
-- strip setext header underlines |
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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'rack', github: 'rack/rack' | |
gem 'i18n', github: 'svenfuchs/i18n' | |
gem 'sqlite3' | |
GEMFILE |
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
# CASE implementation for Arel | |
# Based on: https://github.com/take-five/acts_as_ordered_tree/blob/master/lib/acts_as_ordered_tree/transaction/dsl.rb | |
# Extended with support for CASE expr WHEN expr[, expr, ...] by Felix Buenemann | |
module Arel | |
module Nodes | |
# Case node | |
# | |
# @example | |
# switch.when(table[:x].gt(1), table[:y]).else(table[:z]) |
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 -ur activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | |
--- activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb 2014-07-11 02:35:32.000000000 +0200 | |
+++ activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb 2014-07-11 01:31:14.000000000 +0200 | |
@@ -8,7 +8,7 @@ | |
# Abstract representation of an index definition on a table. Instances of | |
# this type are typically created and returned by methods in database | |
# adapters. e.g. ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#indexes | |
- class IndexDefinition < Struct.new(:table, :name, :unique, :columns, :lengths, :orders, :where, :type, :using) #:nodoc: | |
+ class IndexDefinition < Struct.new(:table, :name, :unique, :columns, :lengths, :orders, :where, :type, :using, :opclass) #:nodoc: | |
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
namespace :ci do | |
desc 'Run rubocop for CI environment' | |
task :rubocop do | |
args = %w{ | |
--require ./lib/rubocop/formatter/progress_formatter_no_report | |
--format Rubocop::Formatter::ProgressFormatterNoReport | |
--require rubocop/formatter/checkstyle_formatter | |
--format Rubocop::Formatter::CheckstyleFormatter | |
--rails | |
--fail-level error |
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/lib/acts_as_tree.rb b/lib/acts_as_tree.rb | |
index 3279d87..1395481 100644 | |
--- a/lib/acts_as_tree.rb | |
+++ b/lib/acts_as_tree.rb | |
@@ -240,7 +240,7 @@ module ActsAsTree | |
# subchild1.leaf? # => true | |
# child1.leaf? # => false | |
def leaf? | |
- children.empty? | |
+ children.size == 0 |