rubocop files update and auto correction
This commit is contained in:
parent
42e8bb11ea
commit
2a30b076b8
88 changed files with 519 additions and 452 deletions
|
|
@ -24,7 +24,7 @@ module Admin
|
|||
|
||||
# Grouping all comments by conference, and by event. It returns {:conference => {:event => [{comment_2}, {comment_1 }]}}
|
||||
def grouped_comments(remarks)
|
||||
remarks.group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
|
||||
remarks.group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by(&:commentable)]}.to_h
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ module Admin
|
|||
|
||||
@active_conferences = Conference.get_active_conferences_for_dashboard # pending or the last two
|
||||
@deactive_conferences = Conference.
|
||||
get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active
|
||||
get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active
|
||||
@conferences = @active_conferences + @deactive_conferences
|
||||
|
||||
@recent_users = User.limit(5).order(created_at: :desc)
|
||||
|
|
@ -101,7 +101,7 @@ module Admin
|
|||
|
||||
@total_submissions = @conference.events.count
|
||||
@new_submissions = @conference.events.
|
||||
where('created_at > ?', current_user.last_sign_in_at).count
|
||||
where('created_at > ?', current_user.last_sign_in_at).count
|
||||
|
||||
@program_length = @conference.current_program_hours
|
||||
@new_program_length = @conference.new_program_hours(current_user.last_sign_in_at)
|
||||
|
|
@ -134,7 +134,7 @@ module Admin
|
|||
|
||||
@difficulty_levels_distribution = @conference.difficulty_levels_distribution
|
||||
@difficulty_levels_distribution_confirmed = @conference.
|
||||
difficulty_levels_distribution(:confirmed)
|
||||
difficulty_levels_distribution(:confirmed)
|
||||
|
||||
@tracks_distribution = @conference.tracks_distribution
|
||||
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module Admin
|
|||
def update
|
||||
@conference.email_settings.update_attributes(params[:email_settings])
|
||||
redirect_to(admin_conference_emails_path(
|
||||
@conference.short_title),
|
||||
@conference.short_title),
|
||||
notice: 'Settings have been successfully updated.')
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ module Admin
|
|||
|
||||
def update
|
||||
if @event.submitter.update_attributes(params[:user]) &&
|
||||
@event.update_attributes(params[:event])
|
||||
@event.update_attributes(params[:event])
|
||||
|
||||
if request.xhr?
|
||||
render js: 'index'
|
||||
|
|
|
|||
|
|
@ -73,12 +73,9 @@ module Admin
|
|||
# Delete question and its answers
|
||||
begin
|
||||
Question.transaction do
|
||||
|
||||
@question.destroy
|
||||
@question.answers.each do |a|
|
||||
a.destroy
|
||||
end
|
||||
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map {|a| a.title}.join ','}"
|
||||
@question.answers.each(&:destroy)
|
||||
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map(&:title).join ','}"
|
||||
end
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
flash[:error] = 'Could not delete question.'
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ module Admin
|
|||
|
||||
def registration_params
|
||||
params.require(:registration).
|
||||
permit(
|
||||
:conference_id, :arrival, :departure,
|
||||
:volunteer,
|
||||
vchoice_ids: [], qanswer_ids: [], event_ids: [],
|
||||
qanswers_attributes: [],
|
||||
user_attributes: [
|
||||
:id, :name, :tshirt, :mobile, :volunteer_experience, :languages,
|
||||
:nickname, :affiliation])
|
||||
permit(
|
||||
:conference_id, :arrival, :departure,
|
||||
:volunteer,
|
||||
vchoice_ids: [], qanswer_ids: [], event_ids: [],
|
||||
qanswers_attributes: [],
|
||||
user_attributes: [
|
||||
:id, :name, :tshirt, :mobile, :volunteer_experience, :languages,
|
||||
:nickname, :affiliation])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module Admin
|
|||
def update
|
||||
if @sponsor.update_attributes(sponsor_params)
|
||||
redirect_to(admin_conference_sponsors_path(
|
||||
conference_id: @conference.short_title),
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully updated.')
|
||||
else
|
||||
flash[:error] = "Update sponsor failed: #{@sponsor.errors.full_messages.join('. ')}."
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module Admin
|
|||
def update
|
||||
if @sponsorship_level.update_attributes(sponsorship_level_params)
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully updated.')
|
||||
else
|
||||
flash[:error] = "Update Sponsorship level failed: #{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def after_sign_in_path_for(_resource)
|
||||
if (can? :view, Conference) &&
|
||||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
admin_conference_index_path
|
||||
else
|
||||
session[:return_to] || root_path
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
if @conference.tickets.any? && !current_user.supports?(@conference)
|
||||
redirect_to conference_tickets_path(@conference.short_title)
|
||||
else
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title)
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title)
|
||||
end
|
||||
else
|
||||
flash[:error] = "Could not create your registration for #{@conference.title}: "\
|
||||
|
|
@ -106,14 +106,14 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
|
||||
def registration_params
|
||||
params.require(:registration).
|
||||
permit(
|
||||
:conference_id, :arrival, :departure,
|
||||
:volunteer,
|
||||
vchoice_ids: [], qanswer_ids: [],
|
||||
qanswers_attributes: [],
|
||||
event_ids: [],
|
||||
user_attributes: [
|
||||
:username, :email, :name, :password, :password_confirmation]
|
||||
)
|
||||
permit(
|
||||
:conference_id, :arrival, :departure,
|
||||
:volunteer,
|
||||
vchoice_ids: [], qanswer_ids: [],
|
||||
qanswers_attributes: [],
|
||||
event_ids: [],
|
||||
user_attributes: [
|
||||
:username, :email, :name, :password, :password_confirmation]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
def configure_permitted_parameters
|
||||
devise_parameter_sanitizer.for(:account_update) do |u|
|
||||
u.
|
||||
permit(:email, :password, :password_confirmation, :current_password, :username)
|
||||
permit(:email, :password, :password_confirmation, :current_password, :username)
|
||||
end
|
||||
devise_parameter_sanitizer.for(:sign_up) do |u|
|
||||
u.
|
||||
permit(:email, :password, :password_confirmation, :name, :username)
|
||||
permit(:email, :password, :password_confirmation, :name, :username)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue