Skip to content

Instantly share code, notes, and snippets.

View edlvj's full-sized avatar
💭
👨‍💼

Eduard Horiach edlvj

💭
👨‍💼
View GitHub Profile
module ConsumerDemo
module Consumer
module Applications
class UnderwritingQuestionsController < ApplicationController
skip_before_action :authenticate_user!
# rubocop:disable Metrics/MethodLength
def index
application = DataStore.get_application(params.to_unsafe_hash[:application_id])
if application.nil?
class RecordActivityDecorator < SimpleDelegator
attr_accessor :activity_params
def initialize(object, activity_params)
@activity_params = activity_params
super(object)
end
def save
save_activity if super
/* eversign embedded.js */
var eversignTest = {
open: function (params) {
params.events = Object.assign({}, params.events);
// create iFrame
var iFrame = document.createElement('iframe');
document.getElementById(params.containerID).appendChild(iFrame);
iFrame.src = params.url;
@edlvj
edlvj / dd
Created October 4, 2019 14:05
Note.where(notable_type: 'Establishment')
.joins(:note_type)
.group('notes.notable_id')
.count
.values
.max
@edlvj
edlvj / dd
Created October 4, 2019 14:05
Note.where(notable_type: 'Establishment')
.joins(:note_type)
.group('notes.notable_id')
.count
.values
.max
# frozen_string_literal: true
# Copyright (c) 2017-2019 SwiftComply
require 'rails_helper'
RSpec.describe 'Deleting an establishment pump out', type: :system do
include_context 'tenant'
let(:establishment) do
# frozen_string_literal: true
# Copyright (c) 2017-2019 SwiftComply
module InspectionActivity
extend ActiveSupport::Concern
def inspection_activity_params
inspection_activity_params = activity_params.dup
inspection_activity_params.merge(action: inspection_activity_action)
end
# frozen_string_literal: true
# Copyright (c) 2017-2019 SwiftComply
require 'rails_helper'
RSpec.describe 'Create enforcement', type: :system do
include_context 'tenant'
let(:enforcement_type) { create(:enforcement_type, tenant: tenant) }
def set_back_url
return if request.referer.blank?
if referer_path.include?(city_establishments_path)
session['gcd_back_url'] = referer_path
return
end
if referer_path.eql?(city_grease_traps_path)
session['gcd_back_url'] = city_grease_traps_path
module BackUrls
extend ActiveSupport::Concern
class Stack
attr_reader :stack
def initialize(stack_storage)
@stack = stack_storage['back_urls'] ||= Array.new
end