Skip to content

Instantly share code, notes, and snippets.

View ehrenmurdick's full-sized avatar

Ehren Murdick ehrenmurdick

View GitHub Profile

This is a tool to find association paths between different models in a rails app.

Example output - the paths from Job to Invoice:

[3] pry(main)> G.from(Job).to(Invoice)
Job.active_fleet_managed_invoice_from_swoop -- Invoice

Job.invoice >- Invoice

Job.owning_company >- Company.fleet_managed_clients -- FleetCompany.end_user_invoices -< Invoice
@ehrenmurdick
ehrenmurdick / logger.rb
Created October 5, 2010 17:39
Pretty print into rails logs
module ActiveSupport
class BufferedLogger
if RAILS_ENV == 'development'
def flowerbox *args
info "=" * 80
info caller[0]
args.each do |a|
info "-" * 80
info a.inspect
end