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
$.ajaxSetup({ | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); | |
} | |
}); |
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
set :shared_paths, { | |
'log' => 'log', | |
'pids' => 'tmp/pids', | |
'sockets' => 'tmp/sockets', | |
} | |
set :symlinks, { | |
'rvmrc' => '.rvmrc', | |
} | |
set :skip_scm, false | |
set :perm_owner, 'git' |
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
#!/bin/bash | |
path="$(realpath $(dirname $0)/..)" | |
source /etc/profile.d/rvm.sh | |
cd /var/www/redmine | |
echo -n "Fetching changests for $(basename ${path}) repository in Redmine ... " | |
bundle exec rails runner -e production "Repository.find_by_url('${path}').fetch_changesets" && echo "OK" || echo "FAIL" |
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 'bundler/vlad' | |
require 'vlad/rvm' | |
set :default_stage, 'production' | |
set :shared_paths, { | |
'log' => 'log', | |
'system' => 'public/system', | |
'pids' => 'tmp/pids', | |
'sockets' => 'tmp/sockets', |
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
set :ruby_rvm_string, "ree-1.8.7-2011.03" | |
set :ruby_rvm_gemset, application | |
set :default_environment, { | |
'PATH' => "/home/git/.rvm/gems/#{ruby_rvm_string}@#{ruby_rvm_gemset}/bin:/home/git/.rvm/gems/#{ruby_rvm_string}@global/bin:/home/git/.rvm/rubies/#{ruby_rvm_string}/bin:/home/git/.rvm/bin:$PATH", | |
'GEM_HOME' => "/home/git/.rvm/gems/#{ruby_rvm_string}@#{ruby_rvm_gemset}", | |
'GEM_PATH' => "/home/git/.rvm/gems/#{ruby_rvm_string}@#{ruby_rvm_gemset}:/home/git/.rvm/gems/#{ruby_rvm_string}@global", | |
'BUNDLE_PATH' => "/home/git/.rvm/gems/#{ruby_rvm_string}@#{ruby_rvm_gemset}:/home/git/.rvm/gems/#{ruby_rvm_string}@global" | |
} |
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
class ExeclyOneValidator < ActiveModel::Validator | |
def validate(record) | |
raise ArgumentError, ":fields option doesn't supplied" unless options.has_key?(:fields) | |
if options[:fields].select { |f| record.read_attribute(f.to_s).present? }.size != 1 | |
_fields = options[:fields].map(&:to_s).map(&:titleize).join(", ") | |
record.errors[:base] << "execly one of #{_fields} must be present" | |
end | |
end | |
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
#!/bin/sh | |
# This BASH script for Rails project. | |
# It runs MySQL embedded server. | |
# It must by under $RAILS_ROOT/script directory. | |
# Author: Alexander Ulyanitsky <[email protected]>. | |
# License: Rails (BSD). | |
case $(uname -s) in | |
Linux) gnu_readlink_bin="readlink";; | |
FreeBSD) gnu_readlink_bin="greadlink";; |
NewerOlder