Skip to content

Instantly share code, notes, and snippets.

View apiv's full-sized avatar

Austin Pivarnik apiv

View GitHub Profile
@sshaw
sshaw / erb_test_fixture.rb
Last active March 9, 2024 02:32
Ruby module that allows you use ERB in your test/spec fixtures and easily load them
require "erb"
require "shellwords"
#
# Use ERB in your test fixtures and easily load them.
#
# By: Skye Shaw (https://github.com/sshaw)
# Date: 2016-06-30
# Source: https://gist.github.com/sshaw/f9bad743bb53d2439501d03fb6056a4c
#
@nathos
nathos / sass-hash-mixin.sass
Last active May 10, 2017 09:10
Using lists like a hash in Sass
@mixin category-colors($after: false)
@each $category in $categories
@if $after == true
.cat-#{nth($category, 1)}:after
background-color: nth($category, 2)
@else
.cat-#{nth($category, 1)}
background-color: nth($category, 2)
From d6cf71ff546cb28a0278ea7c8c45cd378ead42e1 Mon Sep 17 00:00:00 2001
From: Eloy Duran <[email protected]>
Date: Thu, 31 Dec 2009 14:03:04 +0100
Subject: [PATCH 1/5] Add AssociationReflection#collection_association? which returns true if it's for a has_many or has_and_belongs_to_many association.
---
activerecord/lib/active_record/reflection.rb | 9 ++++++++-
activerecord/test/cases/reflection_test.rb | 9 +++++++++
2 files changed, 17 insertions(+), 1 deletions(-)