Sha256: d29c1bbb94b8230b1e9f36e10b08e7818fdd7f6c7452ef100d41352b59afcc3d

Contents?: true

Size: 679 Bytes

Versions: 2

Compression:

Stored size: 679 Bytes

Contents

require 'rails'
module Loofah::ActiveRecord
  class Railtie < Rails::Railtie
    initializer "loofah-activerecord.initialize" do |app|
      railtie_collection = if app.railties.respond_to?(:all) # Rails::VERSION::MAJOR == 3
                             app.railties.all
                           else # Rails::VERSION::MAJOR == 4
                             app.railties
                           end
      activerecord_railtie = railtie_collection.select {|railtie| railtie.class.to_s == "ActiveRecord::Railtie" }
      if activerecord_railtie
        require 'loofah/activerecord/active_record'
        require 'loofah/activerecord/xss_foliate'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loofah-activerecord-2.0.0 lib/loofah/activerecord/railtie.rb
loofah-activerecord-1.2.0 lib/loofah/activerecord/railtie.rb