class NestedScaffold::Generators::Model::TestUnitGenerator

Public Class Methods

new(*) click to toggle source
Calls superclass method
# File lib/generators/test_unit/model_generator.rb, line 12
def initialize(*)
  super

  unless attributes.map {|a| [a.name, a.type.to_s]}.include? [nested_parent_name, 'references']
    #DIRTY HACK add 'references' attribute
    attributes.insert 0, Rails::Generators::GeneratedAttribute.new(nested_parent_name, :references)
  end
end