Skip to content

Commit 892d195

Browse files
committedDec 11, 2012
Merge pull request #379 from haines/mongoid
Include Decoratable in Mongoid::Document
2 parents 7efeaa4 + 051dca6 commit 892d195

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎lib/draper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def self.setup_action_mailer(base)
3737
end
3838
end
3939

40-
def self.setup_active_record(base)
40+
def self.setup_orm(base)
4141
base.class_eval do
4242
include Draper::Decoratable
4343
end

‎lib/draper/railtie.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ class Railtie < Rails::Railtie
3030
end
3131
end
3232

33-
initializer "draper.setup_active_record" do |app|
34-
ActiveSupport.on_load :active_record do
35-
Draper.setup_active_record self
33+
initializer "draper.setup_orm" do |app|
34+
[:active_record, :mongoid].each do |orm|
35+
ActiveSupport.on_load orm do
36+
Draper.setup_orm self
37+
end
3638
end
3739
end
3840

0 commit comments

Comments
 (0)