When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash
method.
It returns a hash of column objects that include a type
attribute (and more database-related information).
Example:
Contract.columns_hash['id'].type
=> :integer
Contract.columns_hash['active'].type
=> :boolean
Contract.columns_hash['updated_at'].type
=> :datetime
Posted by Arne Hartherz to makandra dev (2013-11-28 10:42)