Skip to content

Instantly share code, notes, and snippets.

@lperichon
Created February 20, 2011 17:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lperichon/836107 to your computer and use it in GitHub Desktop.
Save lperichon/836107 to your computer and use it in GitHub Desktop.
Fix DelayedJob - Spree conflict
module Searchlogic
module NamedScopes
# Handles dynamically creating named scopes for ordering by columns. Example:
#
# User.ascend_by_id
# User.descend_by_username
#
# See the README for a more detailed explanation.
module Ordering
module InstanceOverrideMethods
def order(*args)
begin
if condition?(args[0])
send(args[0])
else
super
end
rescue
Rails.logger.debug "Rescued!"
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment