This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://evilmartians.com/chronicles/viewcomponent-in-the-wild-embracing-tailwindcss-classes-and-html-attributes | |
class ApplicationViewComponent < ViewComponentContrib::Base | |
# Move default attrs to a constants so we can re-use it | |
EMPTY_ATTRS = {}.freeze | |
class << self | |
def html_option(name, default: nil, **opts) | |
if default | |
opts[:type] = proc { default.merge(_1) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'oj' | |
gem 'benchmark-ips', require: 'benchmark/ips' | |
gem 'kalibera' | |
gem 'benchmark-memory', require: 'benchmark/memory' | |
gem 'activesupport' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Developer | |
extend self | |
delegate :establish_connection, :clear_all_connections!, :to => ActiveRecord::Base | |
def delayed_debug(scope) | |
detach_process do | |
close_io_objects | |
establish_connection | |
setup_process_name | |
notify_developers |