If you are like many (most?) of us, you have encountered Rails
Credentials/Secrets and secret_key_base
and may have been
left a bit (or more) confused.
This post is an attempt to remove some of that confusion by
I am Will Jessop. I am a contractor and consultant advising on Ruby on Rails performance, upgrades, scaling and hosting.
I deployed, scaled, and debugged Ruby on Rails applications at Engineyard before spending nearly six years working in operations at Basecamp (37signals), the company that created Ruby on Rails itself. After that I spent three years contracting for a large company helping them upgrade their Rails version and stack, implement strong parameters, and generally improve quality in their codebase by implementing data-collection, dashboards and reporting, writing documentation and providing advice, as well as updating code myself, all within the company's many Rails apps, including their main multi-million line monolith.
You have an existing Rails app that you might want some assistance with. You might be in one of the following circumstances:
All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
module FactoryGirl | |
module Doctor | |
module FloatDuration | |
refine Float do | |
def duration | |
t = self | |
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000) | |
end | |
end | |
end |
module FactoryGirl | |
module Syntax | |
module Methods | |
def find_or_create(name, attributes = {}, &block) | |
attributes = FactoryGirl.attributes_for(name).merge(attributes) | |
klass = FactoryGirl.factory_by_name(name).build_class | |
enums = klass.defined_enums | |
find_attributes = attributes.clone | |
find_attributes.keys.each do |key| |
#include "ofMain.h" | |
#include "ofxTiming.h" | |
class ofApp : public ofBaseApp { | |
public: | |
ofVideoGrabber grabber; | |
DelayTimer delay; | |
ofTrueTypeFont font; | |
string description; | |
module FactoryGirl | |
module Syntax | |
module Methods | |
def find_or_create(name, attributes = {}, &block) | |
attributes = FactoryGirl.attributes_for(name).merge(attributes) | |
result = | |
FactoryGirl. | |
factory_by_name(name). | |
build_class. |
module FactoryGirl::Syntax::Methods | |
def find_or_create(name, attributes = {}, &block) | |
factory = FactoryGirl.factory_by_name(name) | |
klass = factory.build_class | |
factory_attributes = FactoryGirl.attributes_for(name) | |
attributes = factory_attributes.merge(attributes) | |
result = klass.find_by(attributes, &block) |