Class: Zaikio::Directory::CurrentOrganization

Inherits:
Base
  • Object
show all
Defined in:
lib/zaikio/directory/current_organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.findObject



8
9
10
# File 'lib/zaikio/directory/current_organization.rb', line 8

def self.find
  all.find_one
end

.find_with_fallback(fallback) ⇒ Object



12
13
14
# File 'lib/zaikio/directory/current_organization.rb', line 12

def self.find_with_fallback(fallback)
  all.with_fallback(fallback).find_one
end

Instance Method Details

#fetchObject



30
31
32
# File 'lib/zaikio/directory/current_organization.rb', line 30

def fetch
  self.attributes = get
end

#membersObject



38
39
40
# File 'lib/zaikio/directory/current_organization.rb', line 38

def members
  memberships.with_fallback.map(&:person)
end

#reloadObject



34
35
36
# File 'lib/zaikio/directory/current_organization.rb', line 34

def reload
  self.attributes = self.class.find.attributes
end