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
# name, state, city | |
class Address < ApplicationRecord | |
has_one :location, as: :locable, dependent: :destroy | |
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
import java.io.IOException; | |
import java.util.Objects; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Configuration; |
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
<%= form_with(model: billboard) do |form| %> | |
<%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %> | |
<div class="dz-default dz-message flex flex-col items-center"> | |
<%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %> | |
<h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5> | |
<p class="text-sm text-subtle">Upload up to 10 files.</p> | |
</div> | |
<% end %> | |
<div class="inline-flex items-center mbs-2 mie-1"> |
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
# This template is inspired on https://github.com/basecamp/audits1984/blob/master/.rubocop.yml | |
# | |
# 1 - Add dependencies to group :development, :test | |
# gem "rubocop", "~> 1.26", require: false | |
# gem "rubocop-performance", require: false | |
# gem "rubocop-rails", require: false | |
# | |
# 2 - Create a file .rubocop.yml and add the lines below | |
# inherit_from: https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml | |
# |
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
# Search | |
gem "elasticsearch-model", "~> 7.1.0" | |
gem "elasticsearch-rails", "~> 7.1.0" | |
gem "geared_pagination" |
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 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 |
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
{ | |
"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 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
gem "abstract_notifier" |
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
class ApplicationController < ActionController::Base | |
include SetCurrentRequestDetails | |
include SetCurrentTimeZone | |
include Authenticate | |
include ForgeryProtection | |
include ErrorResponses | |
include SetSentryUser |
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
# 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 |
OlderNewer