<commit_before>class KassiEventsController < ApplicationController

  before_filter :logged_in

  def index
    @person = Person.find(params[:person_id])
    session[:links_panel_navi] = 'kassi_events'
    save_navi_state(['own', 'profile']) if current_user?(@person)
    @pagination_type = "kassi_events"
    @kassi_events = @person.kassi_events.paginate :page => params[:page], 
                                                  :per_page => per_page,
                                                  :order => "id DESC"
  end
  
  def show
    @person = Person.find(params[:person_id])
    session[:links_panel_navi] = 'kassi_events'
    save_navi_state(['own', 'profile']) if current_user?(@person)
    @pagination_type = "kassi_events"
    @kassi_events = [KassiEvent.find(params[:id])].paginate :page => params[:page], :per_page => per_page
    render :action => :index
  end
  
  # Used to add new comments to an existing Kassi event
  def update
    @kassi_event = KassiEvent.find(params[:id])
    @kassi_event.update_attributes(params[:kassi_event])
    other_party = @kassi_event.get_other_party(@current_user)
    if RAILS_ENV != "development" && other_party.email_when_new_listing_from_friend == 1
      UserMailer.deliver_notification_of_new_comment_to_kassi_event(other_party, @kassi_event, request)
    end  
    flash[:notice] = :feedback_sent
    redirect_to person_kassi_events_path(Person.find(params[:person_id]))
  end
  
end
<commit_msg>Viilausta notifikaatioihin.<commit_after>class KassiEventsController < ApplicationController

  before_filter :logged_in

  def index
    @person = Person.find(params[:person_id])
    session[:links_panel_navi] = 'kassi_events'
    save_navi_state(['own', 'profile']) if current_user?(@person)
    @pagination_type = "kassi_events"
    @kassi_events = @person.kassi_events.paginate :page => params[:page], 
                                                  :per_page => per_page,
                                                  :order => "id DESC"
  end
  
  def show
    @person = Person.find(params[:person_id])
    session[:links_panel_navi] = 'kassi_events'
    save_navi_state(['own', 'profile']) if current_user?(@person)
    @pagination_type = "kassi_events"
    @kassi_events = [KassiEvent.find(params[:id])].paginate :page => params[:page], :per_page => per_page
    render :action => :index
  end
  
  # Used to add new comments to an existing Kassi event
  def update
    @kassi_event = KassiEvent.find(params[:id])
    @kassi_event.update_attributes(params[:kassi_event])
    other_party = @kassi_event.get_other_party(@current_user)
    if RAILS_ENV != "development" && other_party.settings.email_when_new_comment_to_kassi_event == 1
      UserMailer.deliver_notification_of_new_comment_to_kassi_event(other_party, @kassi_event, request)
    end  
    flash[:notice] = :feedback_sent
    redirect_to person_kassi_events_path(Person.find(params[:person_id]))
  end
  
end

{'fraction_non_alphanumeric': 0.11133740665308893, 'fraction_numerical': 0.0006788866259334691, 'mean_word_length': 3.5338461538461536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '812351', 'n_tokens_mistral': 986, 'n_tokens_neox': 972, 'n_words': 163}