Skip to content

Instantly share code, notes, and snippets.

View BarnabeD's full-sized avatar

Barnabé BarnabeD

View GitHub Profile
@BarnabeD
BarnabeD / includes.rb
Created March 21, 2024 15:48 — forked from abhionlyone/includes.rb
Rails includes for nested active-record associations
# https://stackoverflow.com/questions/24397640/rails-nested-includes-on-active-records
# I believe the following should work for you.
Event.includes(users: :profile)
# If you want to include an association (we'll call it C) of an already included association (we'll call it B), you'd use the syntax above. However, if you'd like to include D as well, which is also an association of B, that's when you'd use the array as given in the example in the Rails Guide.
A.includes(bees: [:cees, :dees])
# You could continue to nest includes like that (if you actually need to). Say that A is also associated with Z, and that C is associated to E and F.
@mdang
mdang / RAILS_CHEATSHEET.md
Last active May 18, 2025 11:35
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@rxaviers
rxaviers / gist:7360908
Last active June 13, 2025 14:51
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@tadatoshi
tadatoshi / devise.fr.yml
Created April 26, 2010 21:53
I18n French translation for Devise (http://github.com/plataformatec/devise)
#########################################################################################################
# I18n French translation for Devise (http://github.com/plataformatec/devise)
# I18n traduction française pour Devise
#########################################################################################################
fr:
errors:
messages:
not_found: "n'a pas été trouvé(e)"
already_confirmed: "a déjà été confirmé(e)"