Skip to content

How can we specify boolean columns? #12

@kristallizer

Description

@kristallizer

Since the prop_type kwarg in PropsBuilder#cast_attribute expects a Class, I'm not able to specify a boolean attribute in the model struct using T::Boolean because it's a type alias (T::Private::Types::TypeAlias)

const :is_active, T::Boolean

When I try to eject a model instance:

Parameter 'prop_type': Expected type Class, got type T::Private::Types::SimplePairUnion with hash 4434194183274143389 (TypeError)
Caller: /ruby/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-ejection_seat-0.3.2/lib/activerecord-ejection_seat/props_builder.rb:35
Definition: /ruby/3.3.6/lib/ruby/gems/3.3.0/gems/activerecord-ejection_seat-0.3.2/lib/activerecord-ejection_seat/props_builder.rb:39 (PropsBuilder#cast_attribute)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions