Skip to content

Instantly share code, notes, and snippets.

@anlek
Created August 12, 2010 17:29
Show Gist options
  • Save anlek/521319 to your computer and use it in GitHub Desktop.
Save anlek/521319 to your computer and use it in GitHub Desktop.
Put in your initialiers folder, allows paperclip to work with mongoid
module Paperclip
class << self
def logger #:nodoc:
Rails.logger
end
end
end
module Mongoid::Document::Extensions
module InstanceMethods
def logger
self.class.logger
end
end
module ClassMethods
def column_names
self.fields.keys
end
def logger
Rails.logger
end
end
end
Mongoid::Document::ClassMethods.send :include,
Mongoid::Document::Extensions::ClassMethods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment