Sha256: 5260beaf52fe2eb338e046646c680ca0136f4d569b13c87d55dea181858d67af

Contents?: true

Size: 512 Bytes

Versions: 3

Compression:

Stored size: 512 Bytes

Contents

require 'delayed_paperclip'

module DelayedPaperclip
  if defined? Rails::Railtie
    require 'rails'
    class Railtie < Rails::Railtie
      initializer 'delayed_paperclip.insert_into_active_record' do
        ActiveSupport.on_load :paperclip do
          DelayedPaperclip::Railtie.insert
        end
      end
    end
  end

  class Railtie
    def self.insert
      ActiveRecord::Base.send(:include, DelayedPaperclip)
      Paperclip::Attachment.send :include, DelayedPaperclip::Attachment
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
delayed_paperclip-2.4.2.0 lib/delayed_paperclip/railtie.rb
delayed_paperclip-2.4.1.0 lib/delayed_paperclip/railtie.rb
delayed_paperclip-2.4.0.0 lib/delayed_paperclip/railtie.rb