removing unused code

This commit is contained in:
Brenda Wallace
2019-07-21 14:24:02 +12:00
parent 1e7eb7326f
commit ecb8ad9dfd
3 changed files with 3 additions and 23 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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