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
| # Тактики выбора праймари или реплики | |
| def find_user(uuid) | |
| DatabaseSwitcher.rp { User.find_by!(uuid: uuid) } | |
| end | |
| def find_shipment(number) | |
| DatabaseSwitcher.rsrp { Shipment.find_by!(number: number) } | |
| 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
| ActiveAdmin.register Model do | |
| controller do | |
| before_action :initialize_dynamic_scopes, only: :index | |
| private | |
| def initialize_dynamic_scopes | |
| ParentModel.all.each do |parent_model| | |
| active_admin_config.scope(parent_model.name) { |model_relation| model_relation.where(parent_model: parent_model) } | |
| 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
| root = "/home/deployer/current" | |
| pid "#{root}/tmp/pids/unicorn.pid" | |
| stderr_path "#{root}/log/unicorn_error.log" | |
| stdout_path "#{root}/log/unicorn.log" | |
| listen "/tmp/unicorn.gigmit.com.socket", :backlog => 2048 | |
| preload_app true | |
| working_directory root |