app/commands/decidim/conferences/admin/create_conference_speaker.rb in decidim-conferences-0.27.0.rc1 vs app/commands/decidim/conferences/admin/create_conference_speaker.rb in decidim-conferences-0.27.0.rc2

- old
+ new

@@ -50,12 +50,12 @@ private attr_reader :form, :conference, :current_user - def conference_speaker_with_attributes - attrs = form.attributes.slice( + def conference_speaker_attributes + @conference_speaker_attributes ||= form.attributes.slice( "full_name", "twitter_handle", "personal_url", "position", "affiliation", @@ -65,13 +65,16 @@ conference: conference, user: form.user ).merge( attachment_attributes(:avatar) ) + end + + def conference_speaker_with_attributes conference_speaker = conference.speakers.build conference_speaker.conference = conference - conference_speaker.assign_attributes(attrs) + conference_speaker.assign_attributes(conference_speaker_attributes) conference_speaker end def create_conference_speaker! log_info = { @@ -84,10 +87,10 @@ } @conference_speaker = Decidim.traceability.create!( Decidim::ConferenceSpeaker, current_user, - conference_speaker_with_attributes.attributes, + conference_speaker_attributes, log_info ) end def conference_meetings(speaker)