Class: IdentificationNumber

Inherits:
ApplicationRecord show all
Includes:
Models::Auditable
Defined in:
app/models/identification_number.rb

Overview

== Schema Information

Table name: identification_numbers
Database name: primary

id :integer not null, primary key
category :text
number :string(255)
created_at :datetime
updated_at :datetime
customer_id :integer

Indexes

index_identification_numbers_on_customer_id (customer_id)

Constant Summary collapse

MAIN_US =

Main us.

"EIN/Fed. Tax ID".freeze
MAIN_CA =

Main ca.

"".freeze

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Constants included from Schedulable

Schedulable::SIMPLE_FORM_OPTIONS

Instance Attribute Summary collapse

Belongs to collapse

Methods included from Models::Auditable

#creator, #updater

Class Method Summary collapse

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #should_not_save_version, #stamp_record

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#categoryObject (readonly)



24
# File 'app/models/identification_number.rb', line 24

validates :category, presence: { message: "can't be blank" }

#numberObject (readonly)



23
# File 'app/models/identification_number.rb', line 23

validates :number, presence: true

Class Method Details

.categoriesObject



40
41
42
43
44
45
46
47
# File 'app/models/identification_number.rb', line 40

def self.categories
  [["EIN/Fed. Tax ID", "EIN/Fed. Tax ID"],
   ["Business Number (BN)", "Business Number (BN)"],
   ["Home Improvement License", "Home Improvement License"],
   ["Village License", "Village License"],
   ["D-U-N-S Number", "D-U-N-S Number"],
   ["Other (please specify)", "Other"]]
end

Instance Method Details

#customerCustomer

Returns:

See Also:



21
# File 'app/models/identification_number.rb', line 21

belongs_to :customer, optional: true