12 Matching Annotations
  1. Oct 2023
  2. Aug 2023
    1. I make a file named: app/models/active_storage/attachment.rb. Because it's in your project it takes loading precedence over the Gem version. Then inside we load the Gem version, and then monkeypatch it using class_eval: active_storage_gem_path = Gem::Specification.find_by_name('activestorage').gem_dir require "#{active_storage_gem_path}/app/models/active_storage/attachment" ActiveStorage::Attachment.class_eval do acts_as_taggable on: :tags end The slightly nasty part is locating the original file, since we can't find it normally because our new file takes precedence. This is not necessary in production, so you could put a if Rails.env.production? around it if you like I think.
  3. Jul 2021
  4. Mar 2021
  5. Nov 2020
  6. Oct 2020
  7. Jul 2020
  8. Mar 2020
  9. Feb 2020
  10. Dec 2019