👋 update_attributes
You served us well...
This commit is contained in:
parent
ca80b753e7
commit
85dae98a76
46 changed files with 109 additions and 109 deletions
|
|
@ -53,7 +53,7 @@ module Admin
|
|||
def update
|
||||
@url = admin_conference_booth_path(@conference.short_title, @booth.id)
|
||||
|
||||
@booth.update_attributes(booth_params)
|
||||
@booth.update(booth_params)
|
||||
|
||||
if @booth.save
|
||||
redirect_to admin_conference_booths_path,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ module Admin
|
|||
|
||||
send_mail_on_cfp_dates_updates = @cfp.notify_on_cfp_date_update?
|
||||
|
||||
if @cfp.update_attributes(cfp_params)
|
||||
if @cfp.update(cfp_params)
|
||||
ConferenceCfpUpdateMailJob.perform_later(@conference) if send_mail_on_cfp_dates_updates
|
||||
redirect_to admin_conference_program_cfps_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.'
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ module Admin
|
|||
@conference.assign_attributes(conference_params)
|
||||
send_mail_on_conf_update = @conference.notify_on_dates_changed?
|
||||
|
||||
if @conference.update_attributes(conference_params)
|
||||
if @conference.update(conference_params)
|
||||
ConferenceDateUpdateMailJob.perform_later(@conference) if send_mail_on_conf_update
|
||||
redirect_to edit_admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @difficulty_level.update_attributes(difficulty_level_params)
|
||||
if @difficulty_level.update(difficulty_level_params)
|
||||
redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @event_type.update_attributes(event_type_params)
|
||||
if @event_type.update(event_type_params)
|
||||
redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ module Admin
|
|||
|
||||
def update
|
||||
@languages = @program.languages_list
|
||||
if @event.update_attributes(event_params)
|
||||
if @event.update(event_params)
|
||||
|
||||
if request.xhr?
|
||||
render js: 'index'
|
||||
|
|
@ -142,7 +142,7 @@ module Admin
|
|||
@votes = @event.votes.includes(:user)
|
||||
|
||||
if (votes = current_user.votes.find_by_event_id(params[:id]))
|
||||
votes.update_attributes(rating: params[:rating])
|
||||
votes.update(rating: params[:rating])
|
||||
else
|
||||
@myvote = @event.votes.build
|
||||
@myvote.user = current_user
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @lodging.update_attributes(lodging_params)
|
||||
if @lodging.update(lodging_params)
|
||||
redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @organization.update_attributes(organization_params)
|
||||
if @organization.update(organization_params)
|
||||
redirect_to admin_organizations_path,
|
||||
notice: 'Organization successfully updated'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ module Admin
|
|||
send_mail_on_schedule_public = @program.notify_on_schedule_public?
|
||||
event_schedules_count_was = @program.event_schedules.count
|
||||
|
||||
if @program.update_attributes(program_params)
|
||||
if @program.update(program_params)
|
||||
ConferenceScheduleUpdateMailJob.perform_later(@conference) if send_mail_on_schedule_public
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ module Admin
|
|||
|
||||
# PUT questions/1
|
||||
def update
|
||||
if @question.update_attributes(question_params)
|
||||
if @question.update(question_params)
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated."
|
||||
else
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed. #{@question.errors.full_messages.join('. ')}"
|
||||
|
|
@ -58,7 +58,7 @@ module Admin
|
|||
# Update questions used for the conference
|
||||
def update_conference
|
||||
authorize! :update, Question.new(conference_id: @conference.id)
|
||||
if @conference.update_attributes(conference_params)
|
||||
if @conference.update(conference_params)
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated."
|
||||
else
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed."
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
@user.update_attributes(user_params)
|
||||
@user.update(user_params)
|
||||
|
||||
@registration.update_attributes(registration_params)
|
||||
@registration.update(registration_params)
|
||||
if @registration.save
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title),
|
||||
notice: "Successfully updated registration for #{@registration.user.email}!"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @resource.update_attributes(resource_params)
|
||||
if @resource.update(resource_params)
|
||||
redirect_to admin_conference_resources_path(conference_id: @conference.short_title),
|
||||
notice: 'Resource successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module Admin
|
|||
def update
|
||||
role_name = @role.name
|
||||
|
||||
if @role.update_attributes(role_params)
|
||||
if @role.update(role_params)
|
||||
url = if @track
|
||||
admin_conference_program_track_role_path(@conference.short_title, @track, @role.name)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @room.update_attributes(room_params)
|
||||
if @room.update(room_params)
|
||||
redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @splashpage.update_attributes(splashpage_params)
|
||||
if @splashpage.update(splashpage_params)
|
||||
redirect_to admin_conference_splashpage_path,
|
||||
notice: 'Splashpage successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @sponsor.update_attributes(sponsor_params)
|
||||
if @sponsor.update(sponsor_params)
|
||||
redirect_to admin_conference_sponsors_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully updated.'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @sponsorship_level.update_attributes(sponsorship_level_params)
|
||||
if @sponsorship_level.update(sponsorship_level_params)
|
||||
redirect_to admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully updated.'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Admin
|
|||
|
||||
# PUT questions/1
|
||||
def update
|
||||
if @survey_question.update_attributes(survey_question_params)
|
||||
if @survey_question.update(survey_question_params)
|
||||
redirect_to admin_conference_survey_path(@conference.short_title, @survey), notice: 'Successfully updated Survey Question.'
|
||||
else
|
||||
@url = admin_conference_survey_survey_question_path(@conference.short_title, @survey, @survey_question)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @survey.update_attributes(survey_params)
|
||||
if @survey.update(survey_params)
|
||||
redirect_to admin_conference_surveys_path(@conference.short_title)
|
||||
else
|
||||
@url = admin_conference_survey_path(@conference.short_title, @survey)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @ticket.update_attributes(ticket_params)
|
||||
if @ticket.update(ticket_params)
|
||||
redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @track.update_attributes(track_params)
|
||||
if @track.update(track_params)
|
||||
redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully updated.'
|
||||
else
|
||||
|
|
@ -122,7 +122,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update_selected_schedule
|
||||
if @track.update_attributes(params.require(:track).permit(:selected_schedule_id))
|
||||
if @track.update(params.require(:track).permit(:selected_schedule_id))
|
||||
respond_to do |format|
|
||||
format.js { render json: {} }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ module Admin
|
|||
end
|
||||
end
|
||||
|
||||
if @user.update_attributes(user_params)
|
||||
if @user.update(user_params)
|
||||
redirect_to admin_users_path, notice: "Updated #{@user.name} (#{@user.email})!" + message
|
||||
else
|
||||
redirect_to admin_users_path, error: "Could not update #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @venue.update_attributes(venue_params)
|
||||
if @venue.update(venue_params)
|
||||
redirect_to admin_conference_venue_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
if @conference.update_attributes(conference_params)
|
||||
if @conference.update(conference_params)
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: 'Volunteering options were successfully updated.'
|
||||
else
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), error: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue