Skip to content

Instantly share code, notes, and snippets.

@danielsousaio
danielsousaio / human.rb
Last active November 7, 2017 22:19
PORO with ActiveModel::Naming
en:
activerecord:
models:
something:
one: Something
other: Somethings
class Something
extend ActiveModel::Naming
end
@danielsousaio
danielsousaio / models.rb
Last active October 27, 2017 22:18
Voting Overview
class Item < ApplicationRecord
has_many :groupings
has_many :lists, through: :groupings
end
class List < ApplicationRecord
has_many :groupings
has_many :items, through: :groupings
end