From ecb8ad9dfd2ad0610d432fea765b18a80323a4b8 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 21 Jul 2019 14:24:02 +1200 Subject: [PATCH] removing unused code --- app/controllers/conversations_controller.rb | 5 ++--- app/controllers/messages_controller.rb | 3 +-- app/controllers/notifications_controller.rb | 18 ------------------ 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 6f6ef8515..615df01fb 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -1,8 +1,7 @@ class ConversationsController < ApplicationController respond_to :html before_action :authenticate_member! - # before_action :get_mailbox, :get_box - before_action :check_current_subject_in_conversation, :only => [:show, :update, :destroy] + before_action :check_current_subject_in_conversation, only: %i(show update destroy) def index @conversations = if box.eql? "inbox" @@ -30,7 +29,7 @@ class ConversationsController < ApplicationController end @receipts = if box.eql? 'trash' - mailbox.receipts_for(@conversation).trash + mailbox.receipts_for(@conversation).trash else mailbox.receipts_for(@conversation).not_trash end diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c29144223..cf1acf321 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -25,7 +25,6 @@ class MessagesController < ApplicationController def create if params[:conversation_id].present? @conversation = Mailboxer::Conversation.find(params[:conversation_id]) - # receipts = conversation.receipts_for alfa current_member.reply_to_conversation(@conversation, params[:body]) redirect_to conversation_path(@conversation) else @@ -47,6 +46,6 @@ class MessagesController < ApplicationController @current_subject ||= # current_subject_from_params || # current_subject_from_session || - current_member + current_member end end diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index a82c674f2..ce4edc5cb 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -66,22 +66,4 @@ class NotificationsController < ApplicationController def notification_params params.require(:notification).permit(:sender_id, :recipient_id, :subject, :body, :post_id, :read) end - - def conversation_params(*keys) - fetch_params(:conversation, *keys) - end - - def message_params(*keys) - fetch_params(:message, *keys) - end - - def fetch_params(key, *subkeys) - params[key].instance_eval do - case subkeys.size - when 0 then self - when 1 then self[subkeys.first] - else subkeys.map{|k| self[k] } - end - end - end end