Skip to content

Instantly share code, notes, and snippets.

View dougc84's full-sized avatar

Doug Clark dougc84

View GitHub Profile
@dougc84
dougc84 / m-h-stop.png
Last active December 31, 2015 21:39
Harvest Running Image
Replace Harvest.app/Resources/m-h-stop.png with this image
@dougc84
dougc84 / model.rb
Last active July 17, 2017 04:44
Ransack - Polymorphic Associations Search Ransacker
class MyModel < ActiveRecord::Base
belongs_to :owner, polymorphic: true
ransacker :owner_name, formatter: proc { |value|
# To use this, you have to know what all of the possible owner types can be.
# For this example, the #owner_type could be either Group or Advertiser.
# The fields we want to search on are:
# Group#name
# Advertiser#contact_name
#