Class: SpreeComments::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- SpreeComments::Engine
- Defined in:
- lib/spree_comments.rb
Class Method Summary collapse
Class Method Details
.activate ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/spree_comments.rb', line 10 def self.activate Order.class_eval do acts_as_commentable end Shipment.class_eval do acts_as_commentable end Admin::OrdersController.class_eval do def comments load_object @comment_types = CommentType.find(:all, :conditions => {:applies_to => "Order"} ) end end Admin::ShipmentsController.class_eval do def comments load_object @comment_types = CommentType.find(:all, :conditions => {:applies_to => "Shipment"} ) end end end |