Skip to content

Instantly share code, notes, and snippets.

View bogdan's full-sized avatar
💭
Developing everything, fixing everything, delivering everything

Bogdan Gusiev bogdan

💭
Developing everything, fixing everything, delivering everything
View GitHub Profile

Here’s a minimal, idiomatic Rails example wiring Current.organization into your routes and URL generation using your scoped routes.


1. Current

class Current < ActiveSupport::CurrentAttributes
  attribute :organization
end
Here’s a **minimal, idiomatic Rails example** wiring **`Current.organization`** into your routes and URL generation using your scoped routes.
---
## 1. `Current`
```ruby
class Current < ActiveSupport::CurrentAttributes
attribute :organization
end
Here’s a **minimal, idiomatic Rails example** wiring **`Current.organization`** into your routes and URL generation using your scoped routes.
---
## 1. `Current`
```ruby
class Current < ActiveSupport::CurrentAttributes
attribute :organization
end
@bogdan
bogdan / qq
Created November 1, 2025 19:46
1BRrGeA1mO9N4ZtJFj24uoDAQiRPn5FAl bafkreicykfjup4ete2d25hrvm7ys3vl3wbge6gv2wdb27wxbfru3ildtou.heic image/heif 35872 mwdm1k5QLBuWqVkTGRAqkA== 806 604 2025-10-01T08:47:29.000Z https://drive.google.com/uc?id=1BRrGeA1mO9N4ZtJFj24uoDAQiRPn5FAl&export=download
1OAdZogAIRWmb5OwgzNkc7MiYIIKzfjPS AY2A5116.jpg image/jpeg 146701 RlN236aHfMu7HVFSy74YUg== 1024 683 2024-08-05T16:05:17.000Z https://drive.google.com/uc?id=1OAdZogAIRWmb5OwgzNkc7MiYIIKzfjPS&export=download
1m7XT4b6MVklws1JZ1F2R5fbadyi1PO34 AY2A5096.jpg image/jpeg 312152 w1GQW05j/c/bGMq+gDmkQg== 1024 683 2024-08-05T16:05:13.000Z https://drive.google.com/uc?id=1m7XT4b6MVklws1JZ1F2R5fbadyi1PO34&export=download
1JrVR4GMe70LJUXuEOalu7Jir97W54mH_ IMG_7606.jpg image/jpeg 430681 2PQEsT8HxOobgwvF20TyHg== 2048 1536 2022-04-05T15:23:17.000Z https://drive.google.com/uc?id=1JrVR4GMe70LJUXuEOalu7Jir97W54mH_&export=download
15R4Bp0Qlu1FwuCUh6xMrtUNzhWd4wTnd IMG_7611.jpg image/jpeg 505087 2PhL4m3s9gZ68vZc/EUSZA== 1536 2048 2022-04-05T15:23:17.000Z https://drive.google.com/uc?
require 'net/http'
require 'net/https'
require 'json'
require 'uri'
class ActiveStorage::Service::PinataService < ActiveStorage::Service
BASE_URL = "https://uploads.pinata.cloud"
class_attribute :files, default: {}, instance_writer: false
{
"plus_code" :
{
"compound_code" : "PVFG+4W8 Lisbon, Portugal",
"global_code" : "8CCGPVFG+4W8"
},
"results" :
[
{
"address_components" :
{
"plus_code": {
"compound_code": "V676+C5X White River, CA, USA",
"global_code": "8573V676+C5X"
},
"results": [
{
"address_components": [
{
"long_name": "36261",
{
"plus_code": {
"compound_code": "V676+C5X White River, CA, USA",
"global_code": "8573V676+C5X"
},
"results": [
{
"address_components": [
{
"long_name": "36261",
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Sample API with x-nullable nested schema"
},
"host": "api.example.com",
"basePath": "/v1",
"schemes": ["https"],
"paths": {
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Sample API with x-nullable nested schema"
},
"host": "api.example.com",
"basePath": "/v1",
"schemes": ["https"],
"paths": {