Method: CacheDebugging::Utils.object_partial_path

Defined in:
lib/cache_debugging/utils.rb

.object_partial_path(object) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/cache_debugging/utils.rb', line 31

def self.object_partial_path(object)
  partial = begin
    object.to_partial_path
  rescue 
    object.class.model_name.partial_path
  end
  partial.split("/").tap{|parts| parts.last.gsub!(/^_?/, "_")}.join("/")
end