Recently I was coding something in Ruby on Rails and I came to a question if I can have array as an attribute for my Model. I started look for Rails documentation and found all available datatypes for Active Records migration
I also found that you might use a type that is not in this list as long as it is supported in your database. Database that I primary work with is PostgreSQL. It supports many others data types, like
:hstore (which is a hash). So yes, we can store multiple values (arrays or hashes) in one column.
Here is how the migration file should look like in order to get attribute as array:
class CreateStore < ActiveRecord::Migration
create_table :stores do |t|
t.string :address, array: true, default: 
If you want the default value to be an empty array set the default to , otherwise, the attribute is
nil, until you give it a value.
> #<Store id: 1, name: "SmartCost", address: ["Location 1", "Location 2"] >