Merge pull request #3550 from hennevogel/bugfix/conference-logos
Do not double assign attributes
This commit is contained in:
commit
8c1c451de1
3 changed files with 9 additions and 5 deletions
|
|
@ -90,7 +90,7 @@ module Admin
|
||||||
@conference.assign_attributes(conference_params)
|
@conference.assign_attributes(conference_params)
|
||||||
send_mail_on_conf_update = @conference.notify_on_dates_changed?
|
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
|
ConferenceDateUpdateMailJob.perform_later(@conference) if send_mail_on_conf_update
|
||||||
redirect_to edit_admin_conference_path(id: @conference.short_title),
|
redirect_to edit_admin_conference_path(id: @conference.short_title),
|
||||||
notice: 'Conference was successfully updated.'
|
notice: 'Conference was successfully updated.'
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ module Admin
|
||||||
@votes = @event.votes.includes(:user)
|
@votes = @event.votes.includes(:user)
|
||||||
@difficulty_levels = @program.difficulty_levels
|
@difficulty_levels = @program.difficulty_levels
|
||||||
@versions = @event.versions |
|
@versions = @event.versions |
|
||||||
PaperTrail::Version.where(item_type: 'Commercial').where('object LIKE ?', "%commercialable_id: #{@event.id}\ncommercialable_type: Event%") |
|
@event.commercials.map(&:versions).flatten |
|
||||||
PaperTrail::Version.where(item_type: 'Commercial').where('object_changes LIKE ?', "%commercialable_id:\n- \n- #{@event.id}\ncommercialable_type:\n- \n- Event%") |
|
@event.votes.map(&:versions).flatten
|
||||||
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%")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,12 @@ RSpec.configure do |config|
|
||||||
@request.host = Rails.application.routes.default_url_options[:host]
|
@request.host = Rails.application.routes.default_url_options[:host]
|
||||||
end
|
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
|
# use the config to use
|
||||||
# t('some.locale.key') instead of always having to type I18n.t
|
# t('some.locale.key') instead of always having to type I18n.t
|
||||||
config.include AbstractController::Translation
|
config.include AbstractController::Translation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue