aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehmet Emin İNAÇ <mehmetemininac@gmail.com>2016-02-16 00:31:39 +0200
committerMehmet Emin İNAÇ <mehmetemininac@gmail.com>2016-02-16 01:20:32 +0200
commit215857e0c185530d526dc91cbc3bbaff9c353746 (patch)
tree6ed92dc708e96388fe7cb21aa69c99ee984a8de3
parent156c2cb571af8c2049e61c50232084a9351f428b (diff)
downloadrails-215857e0c185530d526dc91cbc3bbaff9c353746.tar.gz
rails-215857e0c185530d526dc91cbc3bbaff9c353746.tar.bz2
rails-215857e0c185530d526dc91cbc3bbaff9c353746.zip
Dynamically show available sql types [ci skip]
Dynamically list available sql data types based on current database adapter.
-rw-r--r--railties/lib/rails/generators/rails/model/USAGE12
1 files changed, 1 insertions, 11 deletions
diff --git a/railties/lib/rails/generators/rails/model/USAGE b/railties/lib/rails/generators/rails/model/USAGE
index 025bcf4774..c95e523fb5 100644
--- a/railties/lib/rails/generators/rails/model/USAGE
+++ b/railties/lib/rails/generators/rails/model/USAGE
@@ -35,17 +35,7 @@ Available field types:
type. If no type is specified the string type will be used by default.
You can use the following types:
- integer
- primary_key
- decimal
- float
- boolean
- binary
- string
- text
- date
- time
- datetime
+ <%= ActiveRecord::Base.connection.native_database_types.keys.join("\n\t") %>
You can also consider `references` as a kind of type. For instance, if you run: