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
| module ActionDispatch | |
| module Session | |
| class CustomFileStore < ActionDispatch::Session::AbstractStore | |
| def get_session(env, session_id) | |
| session_data = {} | |
| session_id ||= generate_sid | |
| File.open(tmp_file(session_id),'r') do |f| | |
| data = f.read | |
| session_data = ::Marshal.load(data) unless data.empty? | |
| end rescue nil |
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
| require 'yaml' | |
| require 'logger' | |
| require 'active_record' | |
| namespace :db do | |
| def create_database config | |
| options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'} | |
| create_db = lambda do |config| | |
| ActiveRecord::Base.establish_connection config.merge('database' => nil) |
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
| APP_ROOT = File.expand_path(File.dirname(File.dirname(__FILE__))) | |
| worker_processes 1 | |
| working_directory APP_ROOT | |
| timeout 30 | |
| listen APP_ROOT + "/tmp/appname.sock", backlog: 64 | |
| listen "127.0.0.1:8080", tcp_nopush: true |