{"repo":"blocknotes/active_storage_db","free":true,"listed":false,"github":"https://github.com/blocknotes/active_storage_db","clone":"git clone https://github.com/blocknotes/active_storage_db.git","description":"An ActiveStorage service plugin to store files in a PostgreSQL / MySQL / MSSQL / SQLite database","language":"Ruby","stars":59,"topics":["ruby","rails","activestorage","activestorage-service","mysql","postgres","postgresql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Active Storage DB An Active Storage service upload/download plugin that stores files in a PostgreSQL or MySQL database. Experimental support also for MSSQL and SQLite. Attachment data get stored in a binary field (or blob). Useful also with platforms like Heroku (due to their ephemeral file system). Installation - Setup Active Storage in your Rails application - Add to your Gemfile gem 'active storage db' (and execute: bundle ) - Install the gem migrations: bin/rails active storage db:install:migrations (and execute: bin/rails db:migrate ) - Add to your config/routes.rb : mount ActiveStorageDB::Engine = '/active storage db' - Change Active Storage service in config/environments/development.rb to: config.active storage.service = :db - Add to config/storage.yml : Customizations To setup a separate database connection for the ActiveStorageDB migrations and files data: 1. Add a different database configuration per environment to config/database.yml , e.g: 2. Extend the ActiveStorage base record class providing the connects to options (updating config/application.rb / using an initializer for ActiveStorageDB / overriding the base model like in the Rails guide): 3. Move the ActiveStorageDB migrations to the specified migrations path 4. Execute the rails db:migrate task Misc Some utility tasks are available: Development Project created by Mattia Roccoberton, thanks also to the good guys that opened issues and pull requests from time to time. For development information please check ","default_branch":null,"files":null,"tree":[],"storefront":"/r/blocknotes","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/blocknotes/active_storage_db/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}