diff options
author | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2016-02-06 01:20:21 +0200 |
---|---|---|
committer | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2016-02-07 03:22:03 +0200 |
commit | aa38f7d6159574e3cfb3f2e313fa2c5e16e2ee1a (patch) | |
tree | 660e776d5aeb03d330cfd82d0953823b68e95ac5 /activerecord/lib/active_record | |
parent | f4f998d60d0d095c7d49a26b6030bee4cf92a5d3 (diff) | |
download | rails-aa38f7d6159574e3cfb3f2e313fa2c5e16e2ee1a.tar.gz rails-aa38f7d6159574e3cfb3f2e313fa2c5e16e2ee1a.tar.bz2 rails-aa38f7d6159574e3cfb3f2e313fa2c5e16e2ee1a.zip |
Added numeric helper into migrations.
With this addition, you can add a column into the table like:
```
create_table(:numeric_types) do |t|
t.numeric :foo, precision: 10, scale: 2, default: 2.0
end
```
The result of the migration above is same with:
```
create_table(:numeric_types) do |t|
t.decimal :foo, precision: 10, scale: 2, default: 2.0
end
```
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 690e0ba957..cb10ca9929 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -182,6 +182,7 @@ module ActiveRecord end CODE end + alias_method :numeric, :decimal end # Represents the schema of an SQL table in an abstract way. This class @@ -436,6 +437,7 @@ module ActiveRecord # t.bigint # t.float # t.decimal + # t.numeric # t.datetime # t.timestamp # t.time |