struct

Ralph::Cli::InferredAssociation

Inherits Struct / Value / Object

Represents an inferred association from foreign key analysis

Constructors

new(type : Symbol, name : String, class_name : String, foreign_key : String | Nil = nil, polymorphic : Bool = false, polymorphic_name : String | Nil = nil, optional : Bool = false)
Source

Instance methods

class_name

Target class name (e.g., "User", "Post")

Source
class_name=(class_name : String)

Target class name (e.g., "User", "Post")

Source
foreign_key

Foreign key column (nil if convention matches)

Source
foreign_key=(foreign_key : String | Nil)

Foreign key column (nil if convention matches)

Source
name

Association name (e.g., "user", "posts")

Source
name=(name : String)

Association name (e.g., "user", "posts")

Source
optional

Whether the association is optional (FK is nullable)

Source
optional=(optional : Bool)

Whether the association is optional (FK is nullable)

Source
polymorphic

Whether this is a polymorphic association

Source
polymorphic=(polymorphic : Bool)

Whether this is a polymorphic association

Source
polymorphic_name

Polymorphic name (for polymorphic associations)

Source
polymorphic_name=(polymorphic_name : String | Nil)

Polymorphic name (for polymorphic associations)

Source
to_macro_call

Generate the Ralph association macro call

Source
type

Association type (:belongs_to, :has_many, :has_one)

Source
type=(type : Symbol)

Association type (:belongs_to, :has_many, :has_one)

Source