rowland/activerecord-fb-adapter — pull request #14 by vizcay (2013-11-30 03:36:27+00:00)
Title: improve FbColumn#initialize so that limit, precision & scale get set only for correct column types

In FbColumn#initialize, @limit, @precision & @scale where always set.. this caused problems with the schema dump that gets update every time you run a migration (or rake db:schema:dump also). Some datatypes like integer, datetime, etc don't have a limit, precision or scale properties. Also, in the metadata tables of firebird the scale gets stored as negative.. so "field decimal(18, 2)" gets stored as (18, -2) and in the schema.db "t.decimal :precision => 18, :scale => -2" that fails when it gets run.
Summarizing:
- @limit gets set only for VARCHAR & BLOB
- @precision / @scale get set only for DECIMAL & NUMERIC
- @scale gets absoluted to become positive