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 TagBuilder | |
def initialize(context, tag_name, content = nil, klass: nil, default_attributes: {}, **attributes, &block) | |
@context = context | |
@tag_name = tag_name | |
@content = content | |
@klass = klass | |
@default_attributes = default_attributes | |
@attributes = attributes | |
@block = block | |
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
.tabs { | |
display: flex; | |
flex-direction: column; | |
gap: var(--size-2); | |
} | |
.tabs__list { | |
background-color: var(--color-border-light); | |
block-size: var(--size-10); | |
border-radius: var(--rounded-md); |
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
module ApplicationHelper | |
def current_page_with_controllers?(controllers) | |
controllers.any? { |controller| current_page? controller: controller } | |
end | |
def current_page_with_actions?(actions) | |
actions.any? { |action| current_page? action: action } | |
end | |
def current_page_with_controllers_and_actions?(controllers, actions) |
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
.popover { | |
background-color: var(--color-bg); | |
border-width: var(--border); | |
border-radius: var(--rounded-md); | |
box-shadow: var(--shadow-md); | |
color: var(--color-text); | |
inline-size: var(--popover-width, var(--size-72)); | |
margin-block: var(--size-1); | |
padding: var(--size-4); |
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 MedicalRecord < ApplicationRecord | |
enum kind: %i[ imaging results notes ] | |
belongs_to :patient, class_name: "User", inverse_of: :medical_records | |
has_one_attached :document, dependent: :detach | |
scope :with_kind, -> (kind) { where kind: kind } | |
after_create_commit :deliver_updation |
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
# config/database.yml | |
# SQLite. Versions 3.8.0 and up are supported. | |
# gem install sqlite3 | |
# | |
# Ensure the SQLite 3 gem is defined in your Gemfile | |
# gem "sqlite3" | |
# | |
default: &default | |
adapter: sqlite3 |
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 ApplicationController < ActionController::Base | |
include SetCurrentRequestDetails | |
include SetCurrentTimeZone | |
include Authenticate | |
include ForgeryProtection | |
include ErrorResponses | |
include SetSentryUser |
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
gem "abstract_notifier" |
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
{ | |
"workbench.startupEditor": "none", | |
"workbench.colorTheme": "Atom One Light", | |
"workbench.activityBar.visible": false, | |
"editor.minimap.enabled": false, | |
"editor.scrollBeyondLastLine": false, | |
"editor.guides.indentation": false, | |
"editor.fontSize": 14, | |
"editor.tabSize": 2, | |
"editor.renderControlCharacters": false, |
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
module ElasticsearchExtension | |
module Callbacks | |
extend ActiveSupport::Concern | |
included do | |
after_commit -> { IndexJob.perform_later(:create, self.class.name, self.id) }, on: :create | |
after_commit -> { IndexJob.perform_later(:update, self.class.name, self.id) }, on: :update | |
after_commit -> { IndexJob.perform_later(:destroy, self.class.name, self.id) }, on: :destroy | |
end | |
end |
NewerOlder