Sha256: cdb58f394b9d1a45bfe947f29cae6b22662458117687c7914e6d86dba84c48ce

Contents?: true

Size: 698 Bytes

Versions: 1

Compression:

Stored size: 698 Bytes

Contents

module Commontator
  module ThreadsHelper
    def commontable_url(thread)
      thread.config.commontable_url_proc.call(main_app, thread.commontable)
    end
    
    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
      config = closer.commontator_config
      config.commontator_name_method.blank? ? config.anonymous_name : \
      closer.send(config.commontator_name_method)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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