2020-03-25 17:45:53 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Organization is a special attribute for a member, used to mark him as corporation or a non-profit organization.
|
|
|
|
# This is mainly used for invoicing.
|
2020-03-25 10:16:47 +01:00
|
|
|
class Organization < ApplicationRecord
|
2016-08-02 12:27:45 +02:00
|
|
|
belongs_to :profile
|
2019-05-22 12:45:45 +02:00
|
|
|
belongs_to :invoicing_profile
|
2016-08-01 17:36:38 +02:00
|
|
|
has_one :address, as: :placeable, dependent: :destroy
|
|
|
|
accepts_nested_attributes_for :address, allow_destroy: true
|
2016-08-02 18:06:07 +02:00
|
|
|
|
|
|
|
validates :name, presence: true
|
|
|
|
validates :address, presence: true
|
2016-08-01 17:36:38 +02:00
|
|
|
end
|