Skip to content

Instantly share code, notes, and snippets.

View al2o3cr's full-sized avatar

Matt Jones al2o3cr

View GitHub Profile

Keybase proof

I hereby claim:

  • I am al2o3cr on github.
  • I am al2o3cr (https://keybase.io/al2o3cr) on keybase.
  • I have a public key whose fingerprint is 8BFF C530 4A5F 6C05 A195 B6BA 3DCB F07C 45C1 B4CE

To claim this, I am signing this object:

@al2o3cr
al2o3cr / output-4.1.1.log
Created December 8, 2014 03:30
Test case for Rails #17015
Parent Load (0.1ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = ? LIMIT 1 [["id", 1]]
(0.0ms) begin transaction
SQL (0.0ms) INSERT INTO "students" DEFAULT VALUES
SQL (0.0ms) INSERT INTO "student_parents" ("parent_id", "student_id") VALUES (?, ?) [["parent_id", 1], ["student_id", 1]]
(0.0ms) commit transaction
@al2o3cr
al2o3cr / test_association.rb
Last active September 3, 2015 00:44
Issue found investigating rails/rails #21466
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# NOTE: test passes on 4.1.13, fails against 4.2.0+
@al2o3cr
al2o3cr / test_associations.rb
Created September 3, 2015 00:48
Attempted repro for rails/rails #21466
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'activerecord', '4.2.4'
<def tag="js-wrapper" attrs="convert">
<set-scoped vals="&[]">
<do param="default" />
<% if convert %>
<%= "[#{scope.vals.*.inspect.join(', ')}]" %>
<% else %>
<% scope.retval = scope.vals %>
<% end %>
</set-scoped>
</def>
module Outer
module M
def foo
if self.class.superclass.instance_methods.include?('foo')
super
else
puts 'module foo'
end
end
end
<ul id="menunav">
<% Page.main_pages.each do |page| -%>
<li style="width: 90px;">
<% if page.redirect? -%>
<%= link_to page.navlabel, {:action => page.action_name, :controller => page.controller_name, :name => page.name} -%>
<% else -%>
<%= link_to page.navlabel, view_page_path(page.name) %>
<% unless page.sub_pages.empty? -%>
<ul>
<% page.sub_pages.each do |subpage| -%>
en:
reservations:
messages:
create:
success: "The appointment was created successfully"
error: "Couldn't create the appointment. #{errors}"
update:
success: "Changes to the appointment were saved"
<def tag="page" attrs="title, full-title">
<% full_title ||= "#{title} : #{app_name}" %>
<html merge-attrs>
<head param>
<title param><%= strip_tags full_title %></title>
<stylesheet name="reset" />
<do param="scripts">
<javascript param name="prototype, effects, dragdrop, controls, lowpro, hobo-rapid"/>
<if-ie version="lt IE 7" param="fix-ie6">
<def tag="tabs">
<set-scoped tab-names="&[]" tab-contents="&{}">
<ul class="tabs" merge>
<do param="default" />
</ul>
<do repeat="&scope.tab_names">
<div id="#{this}">
<%= scope.tab_contents[this] %>
</div>
</do>