Created
March 24, 2011 03:52
-
-
Save d3r1v3d/884539 to your computer and use it in GitHub Desktop.
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 characters
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 |
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 characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment