About AR relationship

Once you do your has_many :files and belongs_to :folder relationships,
you get folder.file_ids for free.