Sha256: 62fd0c344e201fbb35c0c8b823fff1778449a3e9ccd0062bb47706cda9b8bd14

Contents?: true

Size: 618 Bytes

Versions: 12

Compression:

Stored size: 618 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)
      user = thread.closer
      return Commontator.user_missing_name if user.nil?
      config = user.commontator_config
      config.user_name_method.blank? ? config.user_missing_name : \
        user.send(config.user_name_method)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
commontator-1.1.1 app/helpers/commontator/threads_helper.rb~
commontator-1.1.0 app/helpers/commontator/threads_helper.rb~
commontator-1.0.6 app/helpers/commontator/threads_helper.rb~
commontator-1.0.5 app/helpers/commontator/threads_helper.rb~
commontator-1.0.4 app/helpers/commontator/threads_helper.rb~
commontator-1.0.3 app/helpers/commontator/threads_helper.rb~
commontator-1.0.2 app/helpers/commontator/threads_helper.rb~
commontator-1.0.1 app/helpers/commontator/threads_helper.rb~
commontator-1.0.0 app/helpers/commontator/threads_helper.rb~
commontator-0.5.14 app/helpers/commontator/threads_helper.rb~
commontator-0.5.13 app/helpers/commontator/threads_helper.rb~
commontator-0.5.12 app/helpers/commontator/threads_helper.rb~