View gist:6b963df28ccec53f0031199283dd38e0
[4c015ea6bb27] Started POST "/internal/localization_override" for 127.0.0.1 at 2017-11-22 15:03:21 +0200
[4c015ea6bb27] [ETagCahing] ETag: none
[2017-11-22 15:03:21.601] Processing by Internal::LocalizationOverrideController#create as JSON
[4c015ea6bb27] [master/1] User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 5139 LIMIT 1
[4c015ea6bb27] [master/1] (0.3ms) BEGIN
[4c015ea6bb27] [master/1] SQL (0.5ms) UPDATE `users` SET `perishable_token` = 'wLM6kWLPS4Nb3b5eGhA', `last_request_at` = '2017-11-22 13:03:21', `updated_at` = '2017-11-22 13:03:21' WHERE `users`.`id` = 5139
[4c015ea6bb27] [master/1] CustomAttribute Load (0.5ms) SELECT `custom_attributes`.* FROM `custom_attributes` WHERE `custom_attributes`.`foreign_id` = 5139 AND `custom_attributes`.`model` = 'User'
[4c015ea6bb27] [master/1] (0.3ms) COMMIT
[4c015ea6bb27] [master/1] Account Load (0.6ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 4416 LIMIT 1
[2017-11-22 15:03:21.624] Completed 400 Bad Request
View aa.liquid
{% assign is_self_referral_by_email = false %}
{% if advocate_info.email != blank and friend_info.email != blank %}
{% assign is_similar = advocate_info.email | similar_to_email: friend_info.email %}
{% assign plus_in_fr_email = friend_info.email | regexp_captures: '(\+[\d\w]+)?\@' %}
{% assign plus_in_ad_email = advocate_info.email | regexp_captures: '(\+[\d\w]+)?\@' %}
{% assign fr_email = friend_info.email | remove: plus_in_fr_email[0] %}
{% assign ad_email = advocate_info.email | remove: plus_in_ad_email[0] %}
{% if fr_email != blank and ad_email != blank %}
{% if is_similar or fr_email == ad_email %}
{% assign is_self_referral = true %}
View active_record.rb
module Datagrid
module Drivers
class ActiveRecord < AbstractDriver #:nodoc:
def self.match?(scope)
return false unless defined?(::ActiveRecord)
if scope.is_a?(Class)
scope.ancestors.include?(::ActiveRecord::Base)
else
scope.is_a?(::ActiveRecord::Relation)
View zz.diff
<div class="popup is-terms is-<%= with_overlay ? 'fixed' : claim_page_layout %>" data-popup="terms">
<div class="popup-close" data-toggle="terms">&times;</div>
<div class="popup-title">Terms &amp; Conditions</div>
+ <% if view_name == "advocate_share_page" %>
{% capture terms_and_conditions_copy %}
<p>
To qualify for a promo code, the referred person must (i) be a new customer, (ii) use a referral link to obtain the promo code and (iii) make a purchase on [[ site_url ]] in an amount greater than the minimum amount specified in the referral offer prior to the promo code's expiration. Referring customers will receive a referral credit in their [[ site_url ]] account after the referral is confirmed and the referral credit is approved by a customer service member. Customers are limited to referring two people per household. Referring customers may only earn one referral credit per referred person. In the event a referred person returns a purchased item and their lifetime order value decreases b
View offer_share.rb
# Our architecture didn't allow us
# to customize message body in a right way.
# That is why we fuck it up right here.
def fuck_short_url(text)
return nil unless text
# Offer short url in email should differ from generic one
# Additional parameters should be included:
# share_specific_short_url includes {source: 'email', email_shared_with: email}
# Sometimes we can not avoid this hack because of the following usecase:
# When user is sharing offer via email though talkable offer page
View gist:eed4d23b7c1fe2325420b44725fdf68e
diff --git a/app/models/custom_property.rb b/app/models/custom_property.rb
index eea3a8c70f..5763ecd547 100644
--- a/app/models/custom_property.rb
+++ b/app/models/custom_property.rb
@@ -80,17 +80,12 @@ class CustomProperty < BaseModel
end || CustomProperty.new(key: key, value: existing_properties[key]&.first&.value)
target_property.person = person
target_property.visitor = visitor
- target_property.value = new_properties[key] if new_properties.has_key?(key)
- if target_property.value.nil?
View zz.diff
diff --git a/app/liquid/templates/shared/_offers_claim.erb b/app/liquid/templates/shared/_offers_claim.erb
index b29e040521..03796ab6ff 100644
--- a/app/liquid/templates/shared/_offers_claim.erb
+++ b/app/liquid/templates/shared/_offers_claim.erb
@@ -6,7 +6,7 @@
{% endif %}
{% if friend_reward != blank %}
- {% assign friend_claim_page_hide_coupon_code = "hide_coupon_code" | localize: "Yes", "No", trait: "boolean", default: "No" %}
+ {% assign hide_coupon_code = "hide_coupon_code" | localize: "Yes", "No", trait: "boolean", default: "No" %}
View tickets.txt
Философия покупки авиабилетов и бронирования отелей
Очень часто подходящие билеты по самой выгодной цене продаются на сайтах мягко говоря не удобных для использования.
Это в общем-то логично - чем более удобный сайт по покупке билетов, тем более много сил в него вложено и тем большую комиссию сайт имеет право требовать.
Однако это не все. На данный момент хорошие ИТ специалисты крайне редки и дороги. Поэтому рядовым компаниям просто не под силу сделать хороший сайт по продаже билетов.
Для меня покупка редко проходит гладко. Всегда что-то не так или с сайтом или банковским платежем.
При чем в большинстве случаев причина не понятнa. Первое природное желание человека, столкнувшегося с такой проблемой - разобраться в логике работы сайта и банка. Но к сожалению на практике их логика существует, но крайне сложна и часто уходит в дебри ("Почему так? Ну просто так исторически сложилось"). Причинно-следственные связи есть, но отследить их тяжело.
Это быстро понимаешь в ситуациях, когда оплата произошла, но билет к ва
View reward.rb
def void!
self.update_attribute(:status, BASE_STATUSES[:voided])
# TODO: Need to better figure out which redeem activity to modify...
# For now, see if there was one around the time of the reward creation and void that if found
[:redeem, :referral].each do |r|
void_activities = offer.activities.by_action(r).by_date_times(created_at..(created_at + 5.minutes))
unless void_activities.empty?
activity = void_activities.first
logger.info("Reward#void! reward #{id} voided, voiding #{activity.action} activity: #{activity.id}")
activity.update_attribute(:action, "#{r}_voided")
View dom.rb
class Generator
class Tag
attr_accessort :name, :children, :level
def initialize(name, level = 0, &block)
@name = name
@level = level
@children = []
instance_eval(&block)
end