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
# USAGE: | |
# | |
# class SomeModel < ActiveRecord::Base | |
# include ActiveRecord::PostgresqlExtensions | |
# end | |
# | |
# SomeModel.update_all_returning("count = count + 1", nil, ["id", "count"]) | |
# | |
module ActiveRecord | |
module PostgresqlExtensions |
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
#!/usr/bin/env ruby | |
require "getoptlong" | |
module UnicornCTL | |
class Controller | |
def initialize(args, argv) | |
@args = args | |
@argv = argv | |
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
# -*- encoding: utf-8; mode: ruby; tab-width: 2; indent-tabs-mode: nil -*- | |
def fire_and_forget &block | |
raise ::LocalJumpError, "No block given" unless block_given? | |
Process.detach(fork &block) | |
end | |
# Demo | |
puts "main" |