Sha256: ed09317a1fc10b510ac7334c101201cba157650d9fe3a62bb614ef6325e85fa4

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

module Commontator
  module ThreadsHelper
    def commontable_name(thread)
      config = thread.config
      config.commontable_name.blank? ? \
      thread.commontable.class.name : \
      config.commontable_name
    end
    
    def commontable_id(thread)
      thread.commontable.send(thread.config.commontable_id_method)
    end
    
    def closer_name(thread)
      closer = thread.closer
      return Commontator.commontator_missing_name if closer.nil?
      config = closer.commontator_config
      config.commontator_name_method.blank? ? config.commontator_no_name : \
        closer.send(config.commontator_name_method)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commontator-0.4.1 app/helpers/commontator/threads_helper.rb~