This file contains 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
class MyModel | |
include ActiveModel::Model | |
attr_accessor :name, :email, :options | |
def initialize(attributes = {}) | |
super | |
@options ||= {} | |
end |
This file contains 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
def example(label) | |
puts "## #{label}" | |
yield | |
puts | |
puts | |
end | |
example("Foo.===(v)") do | |
class Foo | |
def self.===(v) |
This file contains 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 "active_support/all" | |
Resource = Struct.new(:absolute_path) | |
paths = [ | |
Resource.new("/bread/crumbs/three"), | |
Resource.new("/bread"), | |
Resource.new("/bread/crumbs"), | |
Resource.new("/bread/crumbs/one"), | |
Resource.new("/bread/crumbs/two"), |
This file contains 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
def avo_flatpickr_pick(selector, with:) | |
base_field = find(selector, visible: false) | |
flatpickr_field_identifier = base_field["data-resource-edit-target"] | |
flatpickr_field = find("[data-resource-edit-target='#{flatpickr_field_identifier}'].flatpickr-input", visible: false) | |
new_selector_id = flatpickr_field["id"] | |
flatpickr_pick("##{new_selector_id}", with: with) | |
end | |
def avo_tagify_select(field_selector, with:, retries: 3) | |
raise("Unable to select '#{with}' from '#{field_selector}'") if retries == 0 |
This file contains 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 | |
class SalesListOrganizationCsvDownload < Avo::BaseAction | |
self.name = "CSV Download" | |
self.may_download_file = true | |
self.confirm_button_label = "Download" | |
def handle(**args) | |
_models, _fields, _current_user, resource = args.values_at(:models, :fields, :current_user, :resource) |
This file contains 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
class Base | |
def initialize(id) | |
@id = id | |
end | |
def name | |
"#{self.class.name} #{@id}" | |
end | |
end |
This file contains 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
Mar 10 09:56:57 PM ==> Cloning from https://github.com/mission-met/bridgetown-test... | |
Mar 10 09:56:57 PM ==> Checking out commit 8942612de1fb5c174fbbf51067e51ca6172d6f5d in branch main | |
Mar 10 09:56:59 PM ==> Downloading cache... | |
Mar 10 09:57:10 PM ==> Downloaded 177MB in 5s. Extraction took 4s. | |
Mar 10 09:57:15 PM ==> Installing dependencies with Yarn... | |
Mar 10 09:57:15 PM yarn install v1.22.17 | |
Mar 10 09:57:15 PM [1/4] Resolving packages... | |
Mar 10 09:57:15 PM success Already up-to-date. | |
Mar 10 09:57:15 PM Done in 0.16s. | |
Mar 10 09:57:15 PM ==> Installing dependencies with bundler... |
This file contains 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
Feb 21 18:20:41 app-name app/web.1 #<Thread:0x00007fe73838ea10 /app/vendor/bundle/ruby/3.0.0/bundler/gems/thredded-9a7158d4a307/lib/thredded/collection_to_strings_with_cache_renderer.rb:84 run> terminated with exception (report_on_exception is true): | |
Feb 21 18:20:41 app-name app/web.1 /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:210:in `block in wait_poll': could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use (ActionView::Template::Error) | |
Feb 21 18:20:41 app-name app/web.1 from /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:199:in `loop' | |
Feb 21 18:20:41 app-name app/web.1 from /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:199:in `wait_poll' | |
Feb 21 18:20:41 app-name app/web.1 from /app/vendor/bundle/ruby/3.0.0/gem |
This file contains 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 "stimulus" | |
import SlimSelect from "slim-select" | |
import "slim-select/dist/slimselect.min.css" | |
import "../style/slimselect-customized.css" | |
export default class extends Controller { | |
connect() { | |
const limit = this.data.get("limit") | |
const placeholder = this.data.get("placeholder") | |
const searchText = this.data.get("no-results") |
NewerOlder