11 Matching Annotations
  1. 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.
  2. Dec 2022
  3. Aug 2021
    1. In the vast majority of cases when I'm using prettier-ignore I'm only really looking to prevent it from breaking my code into new lines, whilst keeping its other transformations such as switching quotes and adding space between brackets. When ignoring single lines, fixing these formatting problems by hand is very manageable. With the ability to have Prettier ignore entire blocks of code I think the ability to specify what you want it to ignore is essential.
  4. Mar 2021
  5. Nov 2020
  6. Oct 2020