Class: ActiveAdmin::Comment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/active_admin/comments/comment.rb

Class Method Summary collapse

Class Method Details

.find_for_resource_in_namespace(resource, namespace) ⇒ Object



23
24
25
26
27
# File 'lib/active_admin/comments/comment.rb', line 23

def self.find_for_resource_in_namespace(resource, namespace)
  where(:resource_type => resource_type(resource),
        :resource_id => resource.id, 
        :namespace => namespace.to_s)
end

.resource_type(record) ⇒ Object



19
20
21
# File 'lib/active_admin/comments/comment.rb', line 19

def self.resource_type(record)
  record.class.base_class.name.to_s
end