Flowdock
method

model_instance

Importance_0
v1.2.6 - Show latest stable - 0 notes - Class: ScaffoldGenerator
model_instance() protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb, line 183
    def model_instance
      base = class_nesting.split('::').inject(Object) do |base, nested|
        break base.const_get(nested) if base.const_defined?(nested)
        base.const_set(nested, Module.new)
      end
      unless base.const_defined?(@class_name_without_nesting)
        base.const_set(@class_name_without_nesting, Class.new(ActiveRecord::Base))
      end
      class_name.constantize.new
    end
Register or log in to add new notes.