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
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of | |
# the mechanics, not a real-world use case. | |
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord | |
# extension that works for any named association. That's what I really wanted! | |
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446 | |
# == DEFINITIONS | |
# - A Taxi is a car for hire. A taxi has_many :passengers. | |
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi. |
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
# Drop this into config/initializers | |
# The resource being consumed should honour the :page parameter (works great with will_paginate) | |
module ActiveResource | |
module Batches | |
module ClassMethods | |
def find_each(options = {}) | |
find_in_batches(options) do |batch| | |
batch.each do |entry| |
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
/*****************************************************************************\ | |
* Batch Spreadsheet Geocoding Script * | |
* Author: Alan Christopher Thomas * | |
* http://alanchristopherthomas.com/ * | |
\*****************************************************************************/ | |
function onOpen() { | |
// Add the Geocode menu | |
SpreadsheetApp.getActiveSpreadsheet().addMenu("Geocoder", [{ | |
name: "Geocode addresses", |