Sha256: 6f7b75460b28c46802eb56cd32a0b62972e1af5464e3ab56854ecface490b713

Contents?: true

Size: 980 Bytes

Versions: 2

Compression:

Stored size: 980 Bytes

Contents

module ActiveAdminAssociations
  class Engine < Rails::Engine
    config.aa_associations = ActiveSupport::OrderedOptions.new
    
    initializer "active_admin_associations.load_extensions" do |app|
      ActiveAdmin::BaseController.helper ActiveAdminAssociationsHelper
      ActiveAdmin::ResourceDSL.send(:include, ActiveAdminAssociations::AssociationActions)
      ActiveAdmin::ResourceDSL.send(:include, ActiveAdminAssociations::FormConfigDSL)
      
      unless app.config.aa_associations.destroy_redirect == false
        ActiveAdmin::BaseController.send(:include, ActiveAdminAssociations::RedirectDestroyActions)
      end
      
      unless app.config.aa_associations.autocomplete == false
        ActiveSupport.on_load(:active_record) do
          ActiveRecord::Base.send(:include, ActiveAdminAssociations::Autocompleter)
        end
      
        Formtastic::Helpers::InputHelper.send(:include, Formtastic::TokenInputDefaultForAssociation)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aa_associations-0.1.2 lib/active_admin_associations/engine.rb
aa_associations-0.1.1 lib/active_admin_associations/engine.rb