instance method create_generated_attribute

Ruby on Rails 6.1.7.10

Since v4.0.13 Last seen in v7.0.10

Available in: v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10

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/behaviour.rb, line 86
        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/behaviour.rb line 86 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generators::Testing::Behaviour

Type at least 2 characters to search.

↑↓ navigate · open · esc close