Sha256: a00e8dca6d29f2dbf01a5a983d3b93cda185dc23c59b946da7e196c721e9ed03

Contents?: true

Size: 521 Bytes

Versions: 4

Compression:

Stored size: 521 Bytes

Contents

require 'rack/cors'

module ForestLiana
  class Engine < ::Rails::Engine
    isolate_namespace ForestLiana

    config.middleware.insert_before 0, 'Rack::Cors' do
      allow do
        origins '*'
        resource '*', headers: :any, methods: :any
      end
    end

    config.after_initialize do
      ActiveRecord::Base.connection.tables.map do |model_name|
        begin
          SerializerFactory.new.serializer_for(model_name.classify.constantize)
        rescue NameError
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
forest_liana-1.0.0.pre.beta.4 lib/forest_liana/engine.rb
forest_liana-1.0.0.pre.beta.3 lib/forest_liana/engine.rb
forest_liana-1.0.0.pre.beta.2 lib/forest_liana/engine.rb
forest_liana-1.0.0.pre.beta.1 lib/forest_liana/engine.rb