Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

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 = [key_value(:dn_attribute, options[:dn_attribute].dump)]
  mapping_options << key_value(:prefix, prefix.dump)
  if options[:classes]
    mapping_options << key_value(: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

[Validate]

Generated with the Darkfish Rdoc Generator 2.