instance method create_generated_attribute

Ruby on Rails 7.2.3

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

create_generated_attribute(attribute_type, name = "test", index = nil)

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

create_generated_attribute(:string, "name")

Parameters

attribute_type req
name opt = "test"
index opt = nil
Source
# File railties/lib/rails/generators/testing/behavior.rb, line 89
        def create_generated_attribute(attribute_type, name = "test", index = nil)
          Rails::Generators::GeneratedAttribute.parse([name, attribute_type, index].compact.join(":"))
        end

Defined in railties/lib/rails/generators/testing/behavior.rb line 89 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generators::Testing::Behavior

Type at least 2 characters to search.

↑↓ navigate · open · esc close