Sha256: 6dc9ffa746fe115f26e191e1bc71d7ed982bc41c5dc7760a6c4eb62a0b1c96ce

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

  class DeviseLdapMultipleGenerator < Rails::Generators::Base

    source_root File.expand_path("../templates", __FILE__)

    argument :user_model, :type => :string, :default => "user", :desc => "Model to update"

    # ToDo: Request user input to use a scope that already exists, or make it a parameter to pass into the generator
    def create_ldap_config
      copy_file "default.yml", "config/ldap/#{user_model}.yml"
    end

    def update_user_model
      gsub_file "app/models/#{options.user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable" if options.update_model?
    end

  end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise_ldap_multiple-0.9.0 lib/generators/devise_ldap_multiple/devise_ldap_multiple_generator.rb