Method: Rails::Generators::Testing::Behavior#create_generated_attribute

Defined in:
railties/lib/rails/generators/testing/behavior.rb

#create_generated_attribute(attribute_type, name = "test", index = nil) ⇒ Object

Create a Rails::Generators::GeneratedAttribute by supplying the attribute type and, optionally, the attribute name:

create_generated_attribute(:string, "name")


85
86
87
# File 'railties/lib/rails/generators/testing/behavior.rb', line 85

def create_generated_attribute(attribute_type, name = "test", index = nil)
  Rails::Generators::GeneratedAttribute.parse([name, attribute_type, index].compact.join(":"))
end