Sha256: 91632c0d7943e35d4ff6e303a22d2c4dfaafafaf91aa3b56b51e93f8c985e847

Contents?: true

Size: 669 Bytes

Versions: 37

Compression:

Stored size: 669 Bytes

Contents

module CurationConcerns
  module Actors
    class AssignRepresentativeActor < AbstractActor
      def create(attributes)
        next_actor.create(attributes) && assign_representative
      end

      private

        def assign_representative
          unless curation_concern.representative_id
            # TODO: Possible optimization here. Does this cause a fetch of ordered_members if they're already loaded?
            representative = nil # curation_concern.ordered_members.association.reader.first.target
            curation_concern.representative = representative if representative
          end
          curation_concern.save
        end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.7 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-2.0.0 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-2.0.0.rc2 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.6 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.5 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.4 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.3 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.2 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-2.0.0.rc1 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.1 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.0 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.7.0.beta1 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.6.3 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.6.2 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.6.1 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.6.0 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.5.0 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.4.0 app/actors/curation_concerns/actors/assign_representative_actor.rb
curation_concerns-1.3.3 app/actors/curation_concerns/actors/assign_representative_actor.rb