Sha256: 83d5117b44816b40cf48d7d488b03b51937732e2abaa6557a0d42be3a107211a
Contents?: true
Size: 515 Bytes
Versions: 16
Compression:
Stored size: 515 Bytes
Contents
# frozen_string_literal: true module Lcms module Engine class Slug attr_reader :resource def initialize(resource) @resource = resource end def value self.class.build_from(resource.directory) end def self.build_from(chain) chain.map(&:parameterize).join('/') end def self.generate_resources_slugs Resource.tree.find_each do |res| res.update_columns slug: Slug.new(res).value end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems