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
# config/initializers/content_for_inside_cache.rb | |
module AbstractController | |
class Base | |
attr_internal :cached_content_for | |
end | |
module Caching | |
# actionpack/lib/action_controller/caching/fragments.rb | |
module Fragments |
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 'facets/hash/recurse' | |
# Usage: | |
# expect(actual).to match_hash(expected) | |
# | |
RSpec::Matchers.define :match_hash do |expected| | |
match do |actual| | |
# Sort hashes before comparing so that the diff only shows actual changes between keys and | |
# values. | |
actual = actual.recurse {|h| h.sort_by {|k,v| k.to_s }.to_h } |
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
d3-force-labels.js |
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
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', '5.1.4' |
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
namespace :spree do | |
desc "Export Products to CSV File" | |
task :export_products => :environment do | |
require 'csv' | |
products = Product.where(:deleted_at => nil).all | |
puts "Exporting to #{RAILS_ROOT}/products.csv" | |
CSV.open("#{RAILS_ROOT}/products.csv", "w") do |csv| | |
csv << [ |