Skip to content

Instantly share code, notes, and snippets.

View belongs_to.html
<h1 id="label-.belongs_to">.belongs_to</h1>
<p>(from gem activerecord-2.3.14)</p>
<h3 id="label-Implementation+from+ActiveRecord%3A%3AAssociations%3A%3AClassMethods">Implementation from ActiveRecord::Associations::ClassMethods</h3>
<hr style="height: 1px">
<pre>belongs_to(association_id, options = {})</pre>
<hr style="height: 1px">
View gist:9a46af4ffd59c65febbc
/var/folders/t2/bgy0lrr56cv01cxt2p1j5z3h0000gn/T/ruby-build.20141030141254.21174 ~
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 503012
Connection: keep-alive
Date: Tue, 28 Oct 2014 07:23:29 GMT
Last-Modified: Fri, 23 May 2014 08:48:21 GMT
ETag: "5fe00cda18ca5daeb43762b80c38e06e"
Accept-Ranges: bytes
Server: AmazonS3
francescob / encrypted_credentials_read.rb
Last active Oct 15, 2020
access rails 5.2 encrypted credentials from a script outside the rails app
View encrypted_credentials_read.rb
#First of all, require all of rails (maybe it doesn't need to be all, but for now it is)
require 'rails/all'
#then i need to slightly overwrite a rails method:
def encrypted(path, key_path: "config/master.key", env_key: "RAILS_MASTER_KEY")
config_path: path,
key_path: key_path,
You can’t perform that action at this time.