Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Include Decoratable in Mongoid::Document #379

Merged
merged 1 commit into from

3 participants

@haines
Collaborator

Closes #375

@steveklabnik steveklabnik merged commit 892d195 into drapergem:master
@jpzwarte

Afaict, this does not work (see #431). This fails to work because Mongoid::Document is not a class, but a module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2012
  1. @haines
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +1 −1  lib/draper.rb
  2. +5 −3 lib/draper/railtie.rb
View
2  lib/draper.rb
@@ -37,7 +37,7 @@ def self.setup_action_mailer(base)
end
end
- def self.setup_active_record(base)
+ def self.setup_orm(base)
base.class_eval do
include Draper::Decoratable
end
View
8 lib/draper/railtie.rb
@@ -30,9 +30,11 @@ class Railtie < Rails::Railtie
end
end
- initializer "draper.setup_active_record" do |app|
- ActiveSupport.on_load :active_record do
- Draper.setup_active_record self
+ initializer "draper.setup_orm" do |app|
+ [:active_record, :mongoid].each do |orm|
+ ActiveSupport.on_load orm do
+ Draper.setup_orm self
+ end
end
end
Something went wrong with that request. Please try again.