Sha256: 8c609f56d5575ed3b4f2309b40ed8301e9ca1f9724040d3f2f730f8d7c5583ff

Contents?: true

Size: 564 Bytes

Versions: 16

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module Lcms
  module Engine
    class GenerateHierarchicalPositions
      def initialize(queryset = nil)
        @queryset = queryset || Resource.all
      end

      def generate!
        puts "====> Generating Resource hierarchical positions\n"
        @queryset.each do |res|
          # obs: were we want a simple sql update statement, without rails callbacks
          res.update_columns hierarchical_position: HierarchicalPosition.new(res).position
          print '.'
        end
        puts "\n"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.5.4 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.5.3 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.5.2 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.5.1 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.5.0 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.4.2 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.4.1 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.4.0 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.3.1 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.1.4 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.3.0 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.1.3 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.2.0 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.1.2 app/services/lcms/engine/generate_hierarchical_positions.rb
lcms-engine-0.1.0 app/services/lcms/engine/generate_hierarchical_positions.rb