Created
March 24, 2011 03:52
Revisions
-
d3r1v3d renamed this gist
Mar 24, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
d3r1v3d revised this gist
Mar 24, 2011 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ class CreateVeryPreciseTimes < ActiveRecord::Migration def up create_table :very_precise_times do |t| t.datetime :measured_at t.double :measured_at_frac end end def down drop_table :very_precise_times end end -
d3r1v3d created this gist
Mar 24, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ module CustomColumnTypes def double(*args) args.last[:limit] = 53 if args.last.is_a? Hash float *args end end module ActiveRecord module ConnectionAdapters class Table include CustomColumnTypes end class TableDefinition include CustomColumnTypes end end end