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 Jun 11, 2021
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 Dec 18, 2017
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 Nov 13, 2017
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