Skip to content

Fallback to sql_type when type is nil #10

@gonzoyumo

Description

@gonzoyumo

When using some DB specific data type that rails doesn't know, Model's column type is nil.
But there's also an attribute called sql_stype which could be used as fallback when type is unknown.

Here is a sample model column using a PG custom TYPE:

#<ActiveRecord::ConnectionAdapters::PostgreSQLColumn:0x007f875a33c2d0 
  @name="notification_frequency", 
  @sql_type="users_notification_frequencies", 
  @null=false,
  @limit=nil,
  @precision=nil,
  @scale=nil,
  @type=nil,
  @default="weekly",
  @primary=false,
  @coder=nil
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions