Sha256: 66b63e4be806a307667217440a5fc10363fea6ba31e4ae23f780d5f1d95b5bb5

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

module ActiveAdmin
  class Comment < ActiveRecord::Base
    # @return [String] The name of the record to use for the polymorphic relationship
    def self.resource_type(resource)
      # original method has 
      # ResourceController::Decorators.undecorate(resource).class.base_class.name.to_s
      # here, but somehow it didn't work
      undecorated = ResourceController::Decorators.undecorate(resource)
      if undecorated.to_s.include?(':')
        undecorated = undecorated.class.to_s
      end
      undecorated.to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-poro-decorator-0.2.0 lib/activeadmin-poro-decorator/comment.rb