foodsoft/plugins/messages/app/controllers/message_threads_controller.rb

13 lines
382 B
Ruby
Raw Normal View History

class MessageThreadsController < ApplicationController
before_action -> { require_plugin_enabled FoodsoftMessages }
def index
2016-03-04 17:24:28 +01:00
@groups = Group.order(:name)
end
def show
2016-03-04 17:24:28 +01:00
@group = Group.find_by_id(params[:id])
@message_threads = Message.readable_for(current_user).threads.where(group: @group).page(params[:page]).per(@per_page).order(created_at: :desc)
end
end