Where can I find a list of data types that can be used in rails 3? (such as text, string, integer, float, date, etc.?) I keep randomly learning about new ones, but I'd love to have a list I could easily refer to.
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
相关文章
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
Do you mean for defining active record migrations? or do you mean Ruby data types?
Here's a link that may help for creating migrations:
Orthogonal Thought - MySQL and Ruby on Rails datatypes
It might be helpful to know generally what these data types are used for:
I hope that helps someone! Also, here's the official list: http://guides.rubyonrails.org/migrations.html#supported-types
It is important to know not only the types but the mapping of these types to the database types, too:
For, example, note that in MS SQL Server we are using:
Here are all the
Rails3
(ActiveRecord migration) datatypes::binary
:boolean
:date
:datetime
:decimal
:float
:integer
:primary_key
:references
:string
:text
:time
:timestamp
Source