Skip to content

Instantly share code, notes, and snippets.

@brunoandradd
Created October 17, 2019 22:03
Show Gist options
  • Save brunoandradd/b87f4131f4559206bad9d7ac72ccac10 to your computer and use it in GitHub Desktop.
Save brunoandradd/b87f4131f4559206bad9d7ac72ccac10 to your computer and use it in GitHub Desktop.
class Unit < ApplicationRecord
store :data, accessors: %i[position phone email], coder: JSON
belongs_to :company, inverse_of: :units, optional: true
belongs_to :unit_parent, class_name: "Unit", foreign_key: "unit_id", optional: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment