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
# Caches Arbre elements in the `Rails.cache`. | |
# | |
# Yielding the first time adds to the output buffer regardless of the | |
# returned value. A cache miss must be handled separately from a hit | |
# to avoid double rendering. | |
# | |
# Returns yielded Arbre on cache miss OR an HTML string wrapped in | |
# an text node on cache hit. | |
def cache_arbre(context, *args, &block) | |
if controller.perform_caching |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "rails", github: "rails/rails" |
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
module PostgresCopyCsv | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Performs a database query to copy results as CSV to an IO object. | |
# | |
# CSV is created directly in PostgreSQL with less overhead then written to | |
# the provided IO object. | |
# | |
# Example |
OlderNewer