Data types in Ruby represents different types of data like text, string, numbers, etc. All data types are based on classes because it is a pure Object-Oriented language.
A Rails Model is a Ruby class that can add database records (think of whole rows in an Excel table), find particular data you're looking for, update that data, or remove data. These common operations are referred to by the acronym CRUD--Create, Remove, Update, Destroy.
There are two categories of scalar types: numeric�s and character strings. Numeric and String Literals All numeric data types in Ruby are descendants of the Numeric class. The immediate child classes of Numeric are Float and Integer. The Integer class has two child classes: Fixnum and Bignum.
Here are all the Rails3
(ActiveRecord migration) datatypes:
:binary
:boolean
:date
:datetime
:decimal
:float
:integer
:primary_key
:references
:string
:text
:time
:timestamp
Source
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:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With