$ ruby fake_smtp_server
require "net/smtp"
= content_tag(:div, html_attributes) do | |
= yield_or_property(:message) |
class Mailcatcher < Formula | |
desc "Catches mail and serves it through a dream." | |
homepage "https://github.com/sj26/mailcatcher" | |
url "https://github.com/sj26/mailcatcher/archive/v0.6.5.zip" | |
sha256 "393303738ec6c7e0254b22b3f6b8f7988363791890516f820e90372afef4d65c" | |
version "0.6.5" | |
def install | |
ENV["GEM_HOME"] = libexec | |
system "gem", "build", "mailcatcher.gemspec" |
# frozen_string_literal: true | |
module ActiveStorage | |
module Validations | |
class FileSizeValidator < ActiveModel::EachValidator | |
include ActiveSupport::NumberHelper | |
MESSAGES = { minimum: :file_size_too_short, maximum: :file_size_too_long }.freeze | |
CHECKS = { minimum: :>=, maximum: :<= }.freeze |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# USAGE: | |
# $ ./list_dependencies.rb | |
# $ ./list_dependencies.rb /path/to/project | |
# | |
# @see: https://stackoverflow.com/questions/44681231/how-to-list-ruby-production-only-dependencies-using-gemfile-lock-and-lockfilepar |
🚀 I create the
dekorator
gem if this interrest you.
Copy ApplicationDecorator
inside app/decorators/application_decorator.rb
and DecoratorsHelper
inside decorators_helper.rb
.
Then you could create and use your own decorators by create new class that extend from ApplicationDecorator
.
My issue was about ordering and pagination. I was ordering a query on a column (of_the_moment_weight
) that could have multi times the same value. Tehcnically, all entries could have the same value.
The result is that some entry appear on multiple page. But it shouldn't be the case.
Use two columns for ordering.
// Loads stimulus controllers from ../components/ folder | |
// | |
// Normal output: | |
// button/button_controller.js => data-controller="button--button" | |
// form/text_field/text_field_controller.js => data-controller="form--text-field--text-field" | |
// | |
// Expected output: | |
// button/button_controller.js => data-controller="button" | |
// form/text_field/text_field_controller.js => data-controller="form--text-field" |
# frozen_string_literal: true | |
module Form | |
class BaseComponent < ApplicationComponent | |
class << self | |
attr_accessor :default_options | |
end | |
include Components::Validations |