class ActiveLdap::Generators::ModelGenerator

def create_model

def create_model
  template 'model_active_ldap.rb', File.join('app/models', class_path, "#{file_name}.rb")
end

def default_prefix

def default_prefix
  "ou=#{name.demodulize.pluralize}"
end

def ldap_mapping(indent=' ')

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

def prefix

def prefix
  options[:prefix] || default_prefix
end