SQL Decimal Support plugin

Plugin details

A little plugin to add support for SQL decimal/numeric types in ActiveRecord for the PostgreSQL, MySQL and M$ SQL Server adapters

Repositoryhttp://svn.itemtrends.lokorin.org/trunk/vendor/plugins/sql_decimal_support/ Author Ashley Moran Tags sql, number LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.itemtrends.lokorin.org/trunk/vendor/plugins/sql_decimal_support/

* SQL decimal/numeric columns in your database are returned as BigDecimal objects instead of Floats

* Migrations support the :decimal type, eg:

      create_table :prices do |table|
        table.column :item_id, :integer, :null => false
        table.column :original_manufacturer_price,
  						:decimal, :precision => 10, :scale => 2
        table.column :discount_percentage,
  						:decimal, :precision => 4, :scale => 2, :default => 0.0
      end
      
      add_column :prices, :sale_price, :decimal, :precision => 10, :scale => 2
  


* SchemaDumper dumps the precision and scale values into the Ruby script, in the same format as above, so you can test databases with decimals

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago