Sha256: cf0af9ad6b7e60b99ace4917ba2680f511657d44c1391e37c8df02de63cfa566
Contents?: true
Size: 542 Bytes
Versions: 21
Compression:
Stored size: 542 Bytes
Contents
module ForestLiana class HasManyAssociator def initialize(resource, association, params) @resource = resource @association = association @params = params @data = params['data'] end def perform @record = @resource.find(@params[:id]) associated_records = @resource.find(@params[:id]).send(@association.name) if @data.is_a?(Array) @data.each do |record_deleted| associated_records << @association.klass.find(record_deleted[:id]) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems