Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Narbonne Zooip

  • Freelance - France
  • France
  • Twitter @alexnarb
View GitHub Profile
@Zooip
Zooip / Example - GET response.json
Last active June 11, 2021 19:04
Graphiti ActiveStorage attachment
View Example - GET response.json
{
"data": {
"id": "2235",
"type": "places",
"attributes": {
"name": "Test name",
"coordinates": {
"lon": 5.11135,
"lat": 45.41
},
@Zooip
Zooip / models.js.erb
Created December 18, 2017 07:44
JsonAPI-rb Devourable Serializable
View models.js.erb
export const song_attributes = <%= SerializableSong.devour_attributes.to_json %>
export const song_document_attributes = <%= SerializableSongDocument.devour_attributes.to_json %>
@Zooip
Zooip / Lock.rb
Created November 13, 2017 15:47
Mongoid lock system
View Lock.rb
class Lock
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::EmbeddedFindable
include GlobalID::Identification
DEFAULT_INTERFACE = :default
embedded_in :lockable, polymorphic: true