Sha256: f0352ef9a186f7f5f13581e644853da686ad728b59b6ef46f1d8187ad5e38566

Contents?: true

Size: 384 Bytes

Versions: 7

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class MessageCell < Decidim::ViewModel
    delegate :current_user, to: :controller

    def show
      render :show
    end

    def message
      @message ||= model
    end

    def sender
      @sender ||= Decidim::UserPresenter.new(message.sender)
    end

    def own_message?
      message.sender == current_user
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.15.2 app/cells/decidim/message_cell.rb
decidim-core-0.15.1 app/cells/decidim/message_cell.rb
decidim-core-0.15.0 app/cells/decidim/message_cell.rb
decidim-core-0.14.4 app/cells/decidim/message_cell.rb
decidim-core-0.14.3 app/cells/decidim/message_cell.rb
decidim-core-0.14.2 app/cells/decidim/message_cell.rb
decidim-core-0.14.1 app/cells/decidim/message_cell.rb