Sha256: eaf5f826c64926bdbae6f25da64a368ea6f24ccd19c62fcfdeb6eb127cbedbe2

Contents?: true

Size: 752 Bytes

Versions: 11

Compression:

Stored size: 752 Bytes

Contents

module Daengine
  class ContentServiceProcessor

    def self.is_windows?
      processor, platform, *rest = RUBY_PLATFORM.split("-")
      platform =~ /mswin/ || platform =~ /mingw/
    end

    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.attributes[:samiCode] 
          da.orderable = c.attributes[:orderable] == 'true'
          da.save!
          break
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
daengine-0.3.2 lib/daengine/content_service_processor.rb
daengine-0.3.1 lib/daengine/content_service_processor.rb
daengine-0.3 lib/daengine/content_service_processor.rb
daengine-0.2.19 lib/daengine/content_service_processor.rb
daengine-0.2.18 lib/daengine/content_service_processor.rb
daengine-0.2.17 lib/daengine/content_service_processor.rb
daengine-0.2.16 lib/daengine/content_service_processor.rb
daengine-0.2.15 lib/daengine/content_service_processor.rb
daengine-0.2.14 lib/daengine/content_service_processor.rb
daengine-0.2.13 lib/daengine/content_service_processor.rb
daengine-0.2.12 lib/daengine/content_service_processor.rb