method
new
v1.1.6 -
Show latest stable
- Class:
ScaffoldGenerator
new(runtime_args, runtime_options = {})public
No documentation available.
# File railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb, line 47
def initialize(runtime_args, runtime_options = {})
super
# Take controller name from the next argument. Default to the pluralized model name.
@controller_name = args.shift
@controller_name ||= ActiveRecord::Base.pluralize_table_names ? @name.pluralize : @name
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
@controller_class_name_without_nesting, @controller_singular_name, @controller_plural_name = inflect_names(base_name)
if @controller_class_nesting.empty?
@controller_class_name = @controller_class_name_without_nesting
else
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
end
end