Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created September 21, 2012 16:27
Show Gist options
  • Save johnbintz/3762481 to your computer and use it in GitHub Desktop.
Save johnbintz/3762481 to your computer and use it in GitHub Desktop.
Ensure Mongoid documents work with Draper
Gem::Specification.new do |s|
s.name = 'draper-mongoid'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'John Bintz'
s.email = '[email protected]'
s.summary = 'Quick little hack to make Mongoid work with Draper wrt model_name'
s.description = 'Quick little hack to make Mongoid work with Draper wrt model_name'
s.files = ['draper-mongoid.rb']
s.require_path = '.'
s.add_dependency 'draper'
s.add_dependency 'mongoid'
end
require 'mongoid'
module Mongoid::Document
def model_name
self.class.model_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment