Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 427 Bytes

acts_as_party.md

File metadata and controls

26 lines (21 loc) · 427 Bytes

Usage

for normal org model, for example group or role etc.

module Wf
  class Group < ApplicationRecord
    has_many :users 
    include Wf::ActsAsParty
    acts_as_party(user: false, party_name: :name)
  end
end

for user model:

module Wf
  class User < ApplicationRecord
    belongs_to :group, optional: true
    include Wf::ActsAsParty
    acts_as_party(user: true, party_name: :name)
  end
end