method

create_sandbox

rails latest stable - Class: ScaffoldGenerator

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.2.6) is shown here.

create_sandbox()
protected

No documentation available.

# File railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb, line 169
    def create_sandbox
      sandbox = ScaffoldingSandbox.new
      sandbox.singular_name = singular_name
      begin
        sandbox.model_instance = model_instance
        sandbox.instance_variable_set("@#{singular_name}", sandbox.model_instance)
      rescue ActiveRecord::StatementInvalid => e
        logger.error "Before updating scaffolding from new DB schema, try creating a table for your model (#{class_name}) named #{class_name.tableize}."
        raise SystemExit
      end
      sandbox.suffix = suffix
      sandbox
    end