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 ArrayColumns | |
extend ActiveSupport::Concern | |
class_methods do | |
def array_columns_sanitize_list(values = []) | |
return [] if values.nil? | |
values.select(&:present?).map(&:to_s).uniq.sort | |
end | |
def array_columns(*column_names) |
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
#!/usr/bin/env sh | |
cd ../vendor | |
mkdir -p sqlite/bin sqlite/lib sqlite/include | |
# ============================================================================================================ | |
# Compile and install sqlite3 (for performance turning and build customizations) | |
# SEE: https://www.sqlite.org/compile.html | |
# NOTE: The sqlite3 Ruby gem will not work with the following compile time flags | |
# * -DSQLITE_OMIT_DEPRECATED |
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
#!/usr/bin/env sh | |
cd ../vendor | |
mkdir -p sqlite/bin | |
mkdir -p sqlite/lib | |
mkdir -p sqlite/include | |
# ============================================================================================================ | |
# Compile and install sqlite3 (for performance turning and build customizations) | |
# SEE: https://www.sqlite.org/compile.html |
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
[aria-hidden="true"] { | |
visibility: hidden; | |
} | |
.anchor { | |
text-decoration: none; | |
} | |
h2:hover .anchor, | |
h3:hover .anchor, |
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 RailsExt | |
module SQLite3Adapter | |
# Perform any necessary initialization upon the newly-established | |
# @raw_connection -- this is the place to modify the adapter's | |
# connection settings, run queries to configure any application-global | |
# "session" variables, etc. | |
# | |
# Implementations may assume this method will only be called while | |
# holding @lock (or from #initialize). | |
# |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "sqlite3" |
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
# frozen_string_literal: true | |
# require "bundler/inline" | |
# | |
# gemfile(true) do | |
# source "https://rubygems.org" | |
# | |
# git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# | |
# gem "rails" |
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
# frozen_string_literal: true | |
# require "bundler/inline" | |
# | |
# gemfile(true) do | |
# source "https://rubygems.org" | |
# | |
# git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# | |
# gem "sqlite3" |
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
# /lib/rails_ext/generated_attribute.rb | |
# Here, we patch the GeneratedAttribute class to add `richer_text` as a field type, which behaves much the same as the `rich_text` type. | |
# We will patch the Model generator as well to tweak the ActiveRecord model generated when this type is used | |
require 'rails/generators/generated_attribute' | |
module Rails | |
module Generators | |
class GeneratedAttribute |
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
import { Controller } from "@hotwired/stimulus" | |
// use with Rails' `time_Tag` helper like so: | |
// <%= time_tag campaign.starts_at, campaign.starts_at.to_formatted_s(:short), data: { controller: "localized-time", localized_time_type_value: "datetime-short" } %> | |
export default class extends Controller { | |
static targets = [ ] | |
static values = { | |
type: String, | |
style: { type: String, default: 'medium' }, | |
locale: { type: String, default: 'default' }, |