Sha256: c8100910a886590a763616533edab28612b5884f1710a18bc5fc5b08cea7f1e5

Contents?: true

Size: 376 Bytes

Versions: 12

Compression:

Stored size: 376 Bytes

Contents

module Kms
  module UpdateStylesheetsText
    extend ActiveSupport::Concern

    included do
      after_commit :restore_text, on: :create
    end

    protected

    def restore_text
      unless stylesheet_or_javascript?
        Asset.where("content_type like '%css%'").each do |asset|
          asset.store_text
          asset.save
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kms-1.2.1 app/models/concerns/kms/update_stylesheets_text.rb
kms-1.2.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-1.1.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-1.0.1 app/models/concerns/kms/update_stylesheets_text.rb
kms-1.0.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.9.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.8.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.7.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.6.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.5.0 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.4.2 app/models/concerns/kms/update_stylesheets_text.rb
kms-0.4.1 app/models/concerns/kms/update_stylesheets_text.rb