Sha256: 2f53cd97b8f77328d1b5ce3db1efbdf78c4e7b31d53cb9c84cfc54b1c01b6336

Contents?: true

Size: 846 Bytes

Versions: 5

Compression:

Stored size: 846 Bytes

Contents

module PostmanMta
  class ConversationsController < ApplicationController
    def index
      render conversation.index(permitted_params)
    end

    [:inbox, :sent, :spam, :trash].each do |folder|
      define_method folder do
        render conversation.folder(folder, permitted_params)
      end
    end

    def show
      render conversation.find(params[:id])
    end

    def read
      render conversation.mark_as_read(permitted_params)
    end

    def unread
      render conversation.mark_as_unread(permitted_params)
    end

    def destroy
      render conversation.move_to_trash(params[:id])
    end

    def move
      render conversation.move(permitted_params)
    end

    private

    def conversation
      @conversation ||= PostmanMta::Conversation.new
    end

    def permitted_params
      params.permit!
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
postman_mta-0.1.7 app/controllers/postman_mta/conversations_controller.rb
postman_mta-0.1.6 app/controllers/postman_mta/conversations_controller.rb
postman_mta-0.1.5 app/controllers/postman_mta/conversations_controller.rb
postman_mta-0.1.4 app/controllers/postman_mta/conversations_controller.rb
postman_mta-0.1.3 app/controllers/postman_mta/conversations_controller.rb