Fixes Hound CI violations

This commit is contained in:
Chrisbr 2014-04-28 21:42:09 +02:00
parent 169fab5c31
commit 8154e6f72c
6 changed files with 44 additions and 32 deletions

View file

@ -11,17 +11,22 @@ class Admin::CallforpapersController < ApplicationController
def update
@cfp = @conference.call_for_papers
@cfp.update_attributes(params[:call_for_papers])
redirect_to(admin_conference_callforpapers_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
notice: 'Call for Papers was successfully updated.')
end
def create
@cfp = CallForPapers.new(params[:call_for_papers])
@cfp = CallForPapers.new(params[:call_for_papers])
@conference.call_for_papers = @cfp
if @cfp.save
redirect_to(admin_conference_callforpapers_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
notice: 'Call for Papers was successfully updated.')
else
redirect_to(admin_conference_callforpapers_path(:id => @conference.short_title), :error => 'Call for Papers failed.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
error: 'Call for Papers failed.')
end
end
end

View file

@ -3,11 +3,12 @@ class Admin::EmailsController < ApplicationController
def update
@conference.email_settings.update_attributes(params[:email_settings])
redirect_to(admin_conference_emails_path(@conference.short_title), :notice => 'Settings have been successfully updated.')
redirect_to(admin_conference_emails_path(
@conference.short_title),
notice: 'Settings have been successfully updated.')
end
def index
@settings = @conference.email_settings
end
end

View file

@ -6,11 +6,13 @@ class Admin::EventtypeController < ApplicationController
end
def update
begin
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_eventtype_path(:conference_id => @conference.short_title), :notice => 'Event types were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_eventtype_path(:conference_id => @conference.short_title), :alert => 'Event types update failed: #{e.message}')
end
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_eventtype_path(
conference_id: @conference.short_title),
notice: 'Event types were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_eventtype_path(
conference_id: @conference.short_title),
alert: 'Event types update failed: #{e.message}')
end
end
end

View file

@ -7,11 +7,13 @@ class Admin::RoomsController < ApplicationController
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_rooms_path(:conference_id => @conference.short_title), :notice => 'Rooms were successfully updated.')
redirect_to(admin_conference_rooms_path(
conference_id: @conference.short_title),
notice: 'Rooms were successfully updated.')
else
redirect_to(admin_conference_rooms_path(:conference_id => @conference.short_title), :notice => 'Room update failed.')
redirect_to(admin_conference_rooms_path(
conference_id: @conference.short_title),
notice: 'Room update failed.')
end
end
end

View file

@ -3,18 +3,20 @@ class Admin::TracksController < ApplicationController
def show
respond_to do |format|
format.html { render :tracks_list}
format.json { render :json => @conference.tracks.to_json }
format.html { render :tracks_list }
format.json { render json: @conference.tracks.to_json }
end
end
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_tracks_path(:conference_id => @conference.short_title), :notice => 'Tracks were successfully updated.')
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks were successfully updated.')
else
redirect_to(admin_conference_tracks_path(:conference_id => @conference.short_title), :notice => 'Tracks update failed.')
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks update failed.')
end
end
end

View file

@ -24,14 +24,14 @@ Osem::Application.routes.draw do
get "/volunteers" => "volunteers#index", :as => "volunteers_info"
put "/volunteers" => "volunteers#update", :as => "volunteers_update"
resources :difficulty_levels, :only => [ :show, :update, :index ]
resources :rooms, :only => [ :show, :update, :index ]
resources :tracks, :only => [ :show, :update, :index ]
resources :eventtype, :only => [ :show, :update, :index ]
resources :social_events, :only => [ :show, :update, :index ]
resources :supporter_levels, :only => [ :show, :update, :index ]
resources :emails, :only => [ :show, :update, :index ]
resources :callforpapers, :only => [ :show, :update, :index ]
resources :difficulty_levels, only: [:show, :update, :index]
resources :rooms, only: [:show, :update, :index]
resources :tracks, only: [:show, :update, :index]
resources :eventtype, only: [:show, :update, :index]
resources :social_events, only: [:show, :update, :index]
resources :supporter_levels, only: [:show, :update, :index]
resources :emails, only: [:show, :update, :index]
resources :callforpapers, only: [:show, :update, :index]
put "/questions/update_conference" => "questions#update_conference"
resources :questions
resources :events do