# class ActiveLdap::Generators::ModelGenerator

### Public Instance Methods

create_model() click to toggle source

    # File lib/rails/generators/active_ldap/model/model_generator.rb, line 18
    def create_model
      template 'model_active_ldap.rb', File.join('app/models', class_path, "#{file_name}.rb")
    end

### Private Instance Methods

default_prefix() click to toggle source

    # File lib/rails/generators/active_ldap/model/model_generator.rb, line 30
    def default_prefix
      "ou=#{name.demodulize.pluralize}"
    end

ldap_mapping(indent=' ') click to toggle source

    # File lib/rails/generators/active_ldap/model/model_generator.rb, line 34
    def ldap_mapping(indent='  ')
      mapping = "ldap_mapping "
      mapping_options = ["dn_attribute: #{options[:dn_attribute].dump}"]
      mapping_options << "prefix: #{prefix.dump}"
      if options[:classes]
        mapping_options << "classes: #{options[:classes].inspect}"
      end
      mapping_options = mapping_options.join(",\n#{indent}#{' ' * mapping.size}")
      "#{indent}#{mapping}#{mapping_options}"
    end

prefix() click to toggle source

    # File lib/rails/generators/active_ldap/model/model_generator.rb, line 26
    def prefix
      options[:prefix] || default_prefix
    end