app/commands/decidim/meetings/admin/update_meeting.rb in decidim-meetings-0.0.5 vs app/commands/decidim/meetings/admin/update_meeting.rb in decidim-meetings-0.0.6
- old
+ new
@@ -18,27 +18,26 @@
#
# Broadcasts :ok if successful, :invalid otherwise.
def call
return broadcast(:invalid) if @form.invalid?
- change_meeting
- return broadcast(:invalid) if Decidim.geocoder.present? && @meeting.address_changed? && !geocode_meeting
- update_meeting
-
- broadcast(:ok)
+ update_meeting!
+ broadcast(:ok, @meeting)
end
private
- def change_meeting
- @meeting.assign_attributes(
+ def update_meeting!
+ @meeting.update_attributes!(
scope: @form.scope,
category: @form.category,
title: @form.title,
description: @form.description,
end_time: @form.end_time,
start_time: @form.start_time,
address: @form.address,
+ latitude: @form.latitude,
+ longitude: @form.longitude,
location: @form.location,
location_hints: @form.location_hints
)
end