Class: Organization

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/organization.rb

Instance Method Summary collapse

Instance Method Details

#create_partyObject



10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/organization.rb', line 10

def create_party
  unless self.party
    pty = Party.new
    pty.description = self.description
    pty.business_party = self

    pty.save
    self.party = pty
    self.save
  end
end

#destroy_partyObject



27
28
29
30
31
# File 'app/models/organization.rb', line 27

def destroy_party
  if self.party
    self.party.destroy
  end
end

#save_partyObject



22
23
24
25
# File 'app/models/organization.rb', line 22

def save_party
  self.party.description = self.description
  self.party.save
end

#to_labelObject



33
34
35
# File 'app/models/organization.rb', line 33

def to_label
  "#{description}"
end