Created
September 21, 2012 16:27
-
-
Save johnbintz/3762481 to your computer and use it in GitHub Desktop.
Ensure Mongoid documents work with Draper
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
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 |
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
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