I\'m going to be starting a project soon that requires support for large-ish binary files. I\'d like to use Ruby on Rails for the webapp, but I\'m concerned with the BLOB su
You can use the :binary type in your ActiveRecord migration and also constrain the maximum size:
class BlobTest < ActiveRecord::Migration
def self.up
create_table :files do |t|
t.column :file_data, :binary, :limit => 1.megabyte
end
end
end
ActiveRecord exposes the BLOB (or CLOB) contents as a Ruby String.