I hereby claim:
- I am joeljunstrom on github.
- I am joeljunstrom (https://keybase.io/joeljunstrom) on keybase.
- I have a public key ASDVC8PAVOwxFxaT3VTiiMu09R0R8dKFfjrE-0uhhDlb9Qo
To claim this, I am signing this object:
| # config/routes.rb | |
| Rails.application.routes.draw do | |
| resource :contact_message, only: [:new, :create], path: "/contact", path_names: {new: "/"} | |
| end | |
| # app/controllers/contact_messages_controller.rb | |
| class ContactMessagesController < ApplicationController | |
| def new | |
| render locals: {form: ContactMessageForm.new} | |
| end |
| class User < ApplicationRecord | |
| attribute :otp_secret, :encrypted | |
| end | |
| class EncryptedType < ActiveRecord::Type::Value | |
| class << self | |
| memoize def secret_key | |
| Rails.application.key_generator.generate_key("encrypted_type") | |
| end | |
| end |
| module Shop | |
| class Stock | |
| attr_reader :items | |
| def self.with(*item_attributes) | |
| new( | |
| *item_attributes.map { |attrs| StockItem.new(**attrs) } | |
| ) | |
| end |
I hereby claim:
To claim this, I am signing this object:
| # frozen_string_literal: true | |
| # Glue code that makes hotwire-spark work under Falcon + async-cable. | |
| # | |
| # hotwire-spark assumes Puma + `rails server`: | |
| # - Hotwire::Spark.enabled? gates install on `defined?(Rails::Server)`, | |
| # which is only set by `rails s`. Falcon boots through its own CLI. | |
| # - The cable server is mounted through the router and upgrades via rack | |
| # hijack + nio4r, which does not cooperate with Falcon's fiber scheduler. | |
| # |
| # frozen_string_literal: true | |
| # = Selectable Attributes | |
| # | |
| # Declares attributes that normally come from an associated record, but which | |
| # can instead be loaded in a single +SELECT+ (via a join) alongside the host | |
| # record. This keeps bulk reads (CSV exports, large index pages) free of N+1 | |
| # association loads, while individual records still resolve the value by walking | |
| # the association when the joined columns were not selected. | |
| # |