Created
August 12, 2010 17:29
-
-
Save anlek/521319 to your computer and use it in GitHub Desktop.
Put in your initialiers folder, allows paperclip to work with mongoid
This file contains hidden or 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 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