Sha256: e1990448aff7b85a6b685ed48ae7df1a0afa3fe5bf85b95d442b7599f7b1ff8a

Contents?: true

Size: 748 Bytes

Versions: 41

Compression:

Stored size: 748 Bytes

Contents

module Daengine
  class ContentServiceProcessor

    def self.process_orderable
      result = DigitalAsset.all
      ContentServiceResource.site = Daengine.config[:content_service_url] # for some reason this doesn't work from the class itself
      cs = ContentServiceResource.find_all
      result.each{ |da| set_orderable(da,cs)}
    end

    def self.set_orderable(da,cs)
      cs.each do |c| 
        if da.sami_code == c.samiCode 
          da.orderable = c.orderable == 'true'
          begin
            da.save!
          rescue Exception => e
            p "unable to set orderable status for #{da.try(:primary_path)}, #{da.errors.try(:first)}"
          end
          break
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
daengine-0.5.13 lib/daengine/content_service_processor.rb
daengine-0.5.9 lib/daengine/content_service_processor.rb
daengine-0.4.9 lib/daengine/content_service_processor.rb
daengine-0.4.8 lib/daengine/content_service_processor.rb
daengine-0.4.7.9 lib/daengine/content_service_processor.rb
daengine-0.4.7.8 lib/daengine/content_service_processor.rb
daengine-0.4.7.7 lib/daengine/content_service_processor.rb
daengine-0.4.7.6 lib/daengine/content_service_processor.rb
daengine-0.4.7.5 lib/daengine/content_service_processor.rb
daengine-0.4.7.3 lib/daengine/content_service_processor.rb
daengine-0.4.7.2 lib/daengine/content_service_processor.rb
daengine-0.4.7.1 lib/daengine/content_service_processor.rb
daengine-0.4.7 lib/daengine/content_service_processor.rb
daengine-0.4.6.5 lib/daengine/content_service_processor.rb
daengine-0.4.6.4 lib/daengine/content_service_processor.rb
daengine-0.4.6.3 lib/daengine/content_service_processor.rb
daengine-0.4.6.2 lib/daengine/content_service_processor.rb
daengine-0.4.6 lib/daengine/content_service_processor.rb
daengine-0.4.5 lib/daengine/content_service_processor.rb
daengine-0.4.0.4 lib/daengine/content_service_processor.rb