source: RedSur/app/controllers/conversation_visibilities_controller.rb @ 101698b

modelo_minuta
Last change on this file since 101698b was 1b91e02, checked in by aosorio <aosorio@…>, 8 years ago

Version para desarrollo local

  • Property mode set to 100755
File size: 803 bytes
Line 
1#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
2#   licensed under the Affero General Public License version 3 or later.  See
3#   the COPYRIGHT file.
4#
5
6class ConversationVisibilitiesController < ApplicationController
7  before_action :authenticate_user!
8
9  def destroy
10    @vis = ConversationVisibility.where(:person_id => current_user.person.id,
11                                        :conversation_id => params[:conversation_id]).first
12    if @vis
13      participants = @vis.conversation.participants.count
14      if @vis.destroy
15        if participants == 1
16          flash[:notice] = I18n.t('conversations.destroy.delete_success')
17        else
18          flash[:notice] = I18n.t('conversations.destroy.hide_success')
19        end
20      end
21    end
22    redirect_to conversations_path
23  end
24end
Note: See TracBrowser for help on using the repository browser.