Merge pull request #3550 from hennevogel/bugfix/conference-logos

Do not double assign attributes
This commit is contained in:
Henne Vogelsang 2025-01-21 17:51:09 +01:00 committed by GitHub
commit 8c1c451de1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View file

@ -90,7 +90,7 @@ module Admin
@conference.assign_attributes(conference_params)
send_mail_on_conf_update = @conference.notify_on_dates_changed?
if @conference.update(conference_params)
if @conference.save
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.'

View file

@ -45,10 +45,8 @@ module Admin
@votes = @event.votes.includes(:user)
@difficulty_levels = @program.difficulty_levels
@versions = @event.versions |
PaperTrail::Version.where(item_type: 'Commercial').where('object LIKE ?', "%commercialable_id: #{@event.id}\ncommercialable_type: Event%") |
PaperTrail::Version.where(item_type: 'Commercial').where('object_changes LIKE ?', "%commercialable_id:\n- \n- #{@event.id}\ncommercialable_type:\n- \n- Event%") |
PaperTrail::Version.where(item_type: 'Vote').where('object_changes LIKE ?', "%\nevent_id:\n- \n- #{@event.id}\n%") |
PaperTrail::Version.where(item_type: 'Vote').where('object LIKE ?', "%\nevent_id: #{@event.id}\n%")
@event.commercials.map(&:versions).flatten |
@event.votes.map(&:versions).flatten
end
def edit

View file

@ -122,6 +122,12 @@ RSpec.configure do |config|
@request.host = Rails.application.routes.default_url_options[:host]
end
config.before(:each) do
Rails.logger.debug '======================================================================'
Rails.logger.debug { "\n\n\n\t\t#{RSpec.current_example.metadata[:full_description]}\n\n\n" }
Rails.logger.debug '======================================================================'
end
# use the config to use
# t('some.locale.key') instead of always having to type I18n.t
config.include AbstractController::Translation