This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Minion | |
def enqueue_or_log(key, args) | |
enqueue(key, args) | |
rescue | |
Rails.logger.error "Unable to enqueue '#{key}' with args '#{args.inspect}': #{$!}" if Rails.logger | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RandomAttributes | |
def self.included(controller) | |
controller.send :extend, ClassMethods | |
controller.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def random_attribute(attr_sym, key_length = 10) | |
cattr_accessor :random_attributes | |
validates_presence_of attr_sym |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class URI::Generic | |
def query_params | |
Hash[(query || '').split('&').collect{ |a| a.split('=') }.collect{ |b| [URI.unescape(b[0]), b[1].nil? ? nil : URI.unescape(b[1])] }] | |
end | |
alias_method :query_parameters, :query_params | |
end |
NewerOlder