Created
November 8, 2017 01:50
-
-
Save danielsousaio/5dfe2fc2047603164ba33b833cecc1ec to your computer and use it in GitHub Desktop.
Ethnicity and Users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# models/concerns/ethnicitable.rb | |
require 'active_support/concern' | |
module Ethnicitable | |
extend ActiveSupport::Concern | |
included do | |
has_and_belongs_to_many :ethnicities | |
end | |
end | |
# models/user.rb | |
class User < ApplicationRecord | |
... | |
include Ethnicitable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment