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
CREATE VIEW v_dynamic_pricing_for_accounts AS | |
SELECT | |
dynamic_pricing_bid_infos.account_id, | |
case | |
when 'red' = ANY(array_agg(dynamic_pricing_bid_infos.exclusive_lead_status)) | |
then 'red' | |
when 'yellow' = ANY(array_agg(dynamic_pricing_bid_infos.exclusive_lead_status)) | |
then 'yellow' | |
else 'green' | |
end exclusive_lead_status, |
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 AddProfileIdToTestimonials < ActiveRecord::Migration | |
def change | |
add_column :testimonials, :profile_ids, :integer, array: true | |
reversible do |dir| | |
dir.up do | |
execute <<-SQL | |
update testimonials set profile_ids = (select array_agg(profiles.id) from profiles | |
where profiles.accounts_id = testimonials.account_id;) | |
SQL |
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
UPDATE call_source_partners | |
SET affiliate_slug = params->>'affiliate_slug', category_id = (params->>'category_id')::integer; | |
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
- if @profile.locations.empty? | |
.info-col.padding-sidegap10 | |
%ul.unstyled | |
%li No Locations Specified | |
- elsif @profile.is_dynamic | |
.info-col | |
.alert.margin-topgap5.padding-gap10 | |
%p.margin-gap0.dynamic-text | |
%span.inline-block You have chosen to display a dynamic serving area. | |
%br |
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 LoadsPresenter | |
extend ActiveSupport::Memoizable | |
def loads; raise "Implement #loads in subclass"; end | |
memoize :loads | |
def each(&block) | |
loads.each(&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
# | |
# Cookbook Name:: delayed_job | |
# Recipe:: default | |
# | |
if ['solo', 'app', 'app_master'].include?(node[:instance_role]) | |
# be sure to replace "app_name" with the name of your application. | |
run_for_app("maloca") do |app_name, data| | |