Skip to content

Instantly share code, notes, and snippets.

View RohanM's full-sized avatar

Rohan Mitchell RohanM

View GitHub Profile
@RohanM
RohanM / ransack.rb
Last active December 16, 2015 00:49 — forked from nilbus/ransack.rb
# Patch for ransack (https://github.com/ernie/ransack) to use scopes
# Helps migrating from Searchlogic or MetaSearch
# Place this file into config/initializer/ransack.rb of your Rails 3.2 project
#
# Usage:
# class Debt < ActiveRecord::Base
# scope_ransackable :overdue
# scope :overdue, lambda { where(["status = 'open' AND due_date < ?", Date.today]) }
# end
#