27 Matching Annotations
  1. Nov 2023
    1. However, depending on your taste, that just might not feel right to you. You might prefer that app/services/users/signup.rb simply defines Services::Users::Signup.
  2. Jul 2023
    1. ActiveStorage::LogSubscriber.detach_from :active_storage

      It's nice that it's that easy to "opt out" of the default provided log subscriber and (if desired) swap in your own custom one that does whatever you want.

  3. Jan 2023
    1. You can use ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags to configure pg_dump. For example, to exclude comments from your structure dump, add this to an initializer: ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = ['--no-comments']
  4. Dec 2022
    1. That may be fine, but if you prefer you can also pass overrides to the inflectors used by the autoloaders: # config/initializers/zeitwerk.rb Rails.autoloaders.main.inflector.inflect("vat" => "VAT") Copy With this option you have more control, because only files called exactly vat.rb or directories exactly called vat will be inflected as VAT. A file called vat_rules.rb is not affected by that and can define VatRules just fine. This may be handy if the project has this kind of naming inconsistencies.
  5. Sep 2022
    1. Otherwise behaves according to the value of null_value_treatment which must be one of 'raise_exception', 'use_json_null', 'delete_key', or 'return_target'. The default is 'use_json_null'.
  6. Aug 2022
  7. Sep 2021
  8. Mar 2021
    1. Or if you need to change the way the string is assembled, you can provide a proc, for example: if defined?(BetterErrors) BetterErrors.editor = proc { |file, line| "vscode://file/%{file}:%{line}" % { file: URI.encode_www_form_component(file), line: line } } end
    1. This is a huge disadvantage to all web developers. Why can't we at least have the ability to turn validation messages off? Why do we have to re-implement a validation system when you already have one in place, but all we want is the validation aspect and not the built in messaging? By taking away the ability to style elements that CHROME adds to the browser window, it is hurting developers professional appearance. We just want to use Chrome's WONDERFUL validation system with our own error messages. Either let us style them, or let us hide them, but don't make us re-invent the wheel just because you don't want our code to be "browser specific". Writing a new validation system just for Chrome is going to be much more "browser (chrome) specific" code than setting "::-webkit-validation-bubble, ::-webkit-validation-bubble * { display: none; }. This isn't just an annoyance, it's a huge disadvantage to any developer who wants to easily utilize Chrome's built in validation. I usually brag about how wonderful Chrome is, but I'm starting to think it's heading in another direction...

  9. Feb 2021
    1. initialize(model) accepts an instance of the model that the form represents.

      By designing this so there is a main model, it isn't as flexible as Reform's "Composition" module that lets you compose it in any way you want, including having as many as you want top-level "main" modules that your form is comprised of.

  10. Jan 2021
    1. premailer-rails and premailer require a gem that is used to parse the email's HTML. For a list of supported gems and how to select which one to use, please refer to the Adapter section of premailer. Note that there is no hard dependency from either gem so you should add one yourself.
  11. Nov 2020
    1. In Angular CLI 6 this command has been removed, and it will not come back. Instead there is a new concept called Builders.With the new Angular CLI you can customize the build process by defining your own builders as well as using one of the builders provided by the community.

      Why did they remove it if it was useful? They wanted people to be stuck in Angular CLI world? Couldn't they still provide that escape route / migration path for those that really do need/want to eject?

    2. In Angular CLI 1.x (Angular 5) you had ng eject command for this, which was ejecting the whole underlying webpack configuration and allowing you to modify it as you please.
  12. Oct 2020
    1. To silence circular dependencies warnings for let's say moment library use: // rollup.config.js import path from 'path' const onwarn = warning => { // Silence circular dependency warning for moment package if ( warning.code === 'CIRCULAR_DEPENDENCY' && !warning.importer.indexOf(path.normalize('node_modules/moment/src/lib/')) ) { return } console.warn(`(!) ${warning.message}`) }
  13. Sep 2020
    1. Then, the projects that use these libraries get to process these import statements how they like when they are bundled. For the ones that wish to load jQuery from a global, we again mark 'jquery' as an external—since we still don't want Rollup to bundle jQuery—and as a global.
    1. Svelte will not offer a generic way to support style customizing via contextual class overrides (as we'd do it in plain HTML). Instead we'll invent something new that is entirely different. If a child component is provided and does not anticipate some contextual usage scenario (style wise) you'd need to copy it or hack around that via :global hacks.
  14. Jun 2020
  15. May 2020
    1. In a basic configuration, GitLab runs a pipeline each time changes are pushed to a branch. If you want the pipeline to run jobs only when merge requests are created or updated, you can use pipelines for merge requests.
  16. Apr 2020
  17. Apr 2017
    1. var myChart = chart().width(720).height(80); Modifying an existing chart is similarly easy: myChart.height(500); As is inspecting it: myChart.height(); // 500 Internally, the chart implementation becomes slightly more complex to support getter-setter methods, but convenience for the user merits additional developer effort! (And besides, this pattern becomes natural after you’ve used it for a while.) function chart() { var width = 720, // default width height = 80; // default height function my() { // generate chart here, using `width` and `height` } my.width = function(value) { if (!arguments.length) return width; width = value; return my; }; my.height = function(value) { if (!arguments.length) return height; height = value; return my; }; return my; } To sum up: implement charts as closures with getter-setter methods.