I hereby claim:
- I am tylerhunt on github.
- I am tylerhunt (https://keybase.io/tylerhunt) on keybase.
- I have a public key whose fingerprint is 9E14 9931 48C7 405F 4372 B2A5 ACAA 8C6F 2C0A A4C5
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # What I should have to do: | |
| require 'active_model/validations' | |
| # What I actually have to do: | |
| require 'active_support/callbacks' | |
| require 'active_support/concern' | |
| require 'active_support/core_ext/module/delegation' | |
| require 'active_model/callbacks' | |
| require 'active_model/errors' | |
| require 'active_model/naming' |
| module Void | |
| def void(method_name) | |
| method = instance_method(method_name) | |
| remove_method method_name | |
| define_method(method_name) do |*args, &block| | |
| method.bind(self).call(*args, &block).tap do |return_value| | |
| raise TypeError, 'unexpected return value' unless return_value.nil? | |
| end | |
| end |
The guide Asset Pipeline Error Pages now no longer works, since non-digest assets aren't generated in newer Rails apps. To fix this, I've replaced the config/initializers/exceptions.rb initializer that swaps out the middleware with the Rake task here, which will be run after Rails assets:precompile task.
| class MyRackApp | |
| def initialize(app) | |
| stack = Rack::Buidler | |
| # stack.use … | |
| stack.run app | |
| @app = stack.to_app | |
| end | |
| def call(env) |
| module Dependencies | |
| # Ensure dependencies from the superclass are inherited by the subclass. | |
| def inherited(subclass) | |
| if superclass.respond_to?(:dependencies) | |
| subclass.dependencies.concat dependencies | |
| end | |
| super | |
| end |
| require 'delegate' | |
| # An abstract decorator useful for decorating Active Record objects. | |
| class ActiveRecordDecorator < SimpleDelegator | |
| # A proxy for the decorator class to allow the delegation of certain class | |
| # methods to the decorated object's class. | |
| class ClassProxy < SimpleDelegator | |
| def initialize(decorator_class, decorated_class) | |
| super decorator_class | |
| self.decorated_class = decorated_class |
| module RenderingHelper | |
| # Override Rails' #render helper to fix an issue with it not honoring objects | |
| # with #to_partial_path definitions that return absolute paths, which is | |
| # problematic when rendering partials within a namespaced controller. | |
| def render(options={}, locals={}, &block) | |
| return super unless options.respond_to?(:to_partial_path) | |
| object = options | |
| path = object.to_partial_path |
| RSpec.shared_context 'Global ID', :global_id do | |
| def global_id_instance_double(doubled_class, stubs={}) | |
| instance_double(doubled_class, stubs) | |
| .extend(GlobalID::Identification) | |
| .tap { |double| | |
| unless double.respond_to?(:id) | |
| allow(double).to receive(:id).and_return(double.object_id) | |
| end | |
| } | |
| end |
| ENV['COMPOSE_PROJECT_NAME'] ||= 'citus' | |
| ENV['MASTER_EXTERNAL_PORT'] ||= '5433' | |
| file 'docker-compose.yml' do | |
| `curl -L https://raw.githubusercontent.com/citusdata/docker/master/docker-compose.yml > docker-compose.yml` | |
| end | |
| namespace :citus do | |
| desc 'Start the Citus cluster' | |
| task :up, [:workers] => 'docker-compose.yml' do |_task, args| |