Skip to content

Instantly share code, notes, and snippets.

@alehmann
alehmann / context.rb
Last active April 18, 2018 03:31
Overriden ransack evaluate method in context.rb to support simple custom sort scopes
# A custom initializer that enables sorting via custom scopes in Ransack (like the same feature in MetaSearch)
module Ransack
module Adapters
module ActiveRecord
class Context < ::Ransack::Context
# Allows for sorting by custom scopes
#
#