tech-angels / annotator

Keep model fields commented in your rails apps.
MIT License
64 stars 5 forks source link

Fallback to sql_type when type is nil #10

Open gonzoyumo opened 11 years ago

gonzoyumo commented 11 years ago

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
>