mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 09:17:20 -04:00
removing unused code
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user