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
0x00e74CB7504cAf13C163A5BEa941A1C8fbe7afd7 |
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
Hotspot::Page.where(page_type: 'Advertising').find_each do |row| | |
button_type = case row.redirect_text | |
when nil, '' then 'full_screen' | |
when 'верх' then 'top_screen' | |
when 'центр' then 'middle_screen' | |
when 'низ' then 'bottom_screen' | |
else 'button_screen' | |
end | |
row.update_columns(redirect_text: '', button_type: button_type) |
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
def clean_whitespaces | |
%i(tag router_id mac_address access_code).each do |field| | |
unless self.send(field).nil? | |
self.send("#{field}=", self.send(field).squish.strip) | |
end | |
end | |
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
[*'A'..'Z', *'a'..'z', *0..9].shuffle.sample(8).join |
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 | |
before_filter :globalize_session, :error_to_flash | |
protected | |
def globalize_session | |
Thread.current[:session] = session | |
end | |
def error_to_flash |
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 'eu_central_bank' | |
gem 'geocoder' | |
gem 'money-rails' | |
# for rate worker | |
gem 'sidekiq' | |
gem 'sidetiq' | |
gem 'sinatra', require: 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
set :private_pub_pid, -> { "#{current_path}/tmp/pids/private_pub.pid" } | |
set :private_pub_socket, -> { "#{current_path}/tmp/sockets/private_pub.sock" } | |
set :private_pub_rackup, -> { "#{current_path}/private_pub.ru" } | |
namespace :private_pub do | |
desc "Start private_pub server" | |
task :start do | |
on roles(:app) do | |
within release_path do | |
with rails_env: fetch(:stage) do |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream thin_websocket { | |
server unix:/path/to/thin/socket/file.sock fail_timeout=0; | |
} | |
server { |