Class: DataDictionarySet
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- DataDictionarySet
- Includes:
- Models::Auditable
- Defined in:
- app/models/data_dictionary_set.rb
Overview
== Schema Information
Table name: data_dictionary_sets
Database name: primary
id :integer not null, primary key
default_set :boolean
destination :string(255)
set_name :string(255)
Constant Summary
Constants included from Models::Auditable
Models::Auditable::ALWAYS_IGNORED
Constants included from Schedulable
Schedulable::SIMPLE_FORM_OPTIONS
Instance Attribute Summary collapse
- #destination ⇒ Object readonly
- #set_name ⇒ Object readonly
Has many collapse
- #data_dictionaries ⇒ ActiveRecord::Relation<DataDictionary>
- #data_import_column ⇒ ActiveRecord::Relation<DataImportColumn>
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Models::Auditable
#all_skipped_columns, #audit_reference_data, #creator, #should_not_save_version, #stamp_record, #updater
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Attribute Details
#destination ⇒ Object (readonly)
18 |
# File 'app/models/data_dictionary_set.rb', line 18 validates :set_name, :destination, presence: true |
#set_name ⇒ Object (readonly)
18 |
# File 'app/models/data_dictionary_set.rb', line 18 validates :set_name, :destination, presence: true |
Class Method Details
.destination_options_for_select ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/models/data_dictionary_set.rb', line 23 def self. [ "customer.company_name", "customer.first_name", "customer.middle_name", "customer.last_name", "customer.profile_id", "customer.primary_sales_rep_id", "customer.buying_group_id", "customer.affiliations", "billing_address.street1", "billing_address.street2", "billing_address.city", "billing_address.state_code", "billing_address.zip", "billing_address.country_iso3", "customer.phone", "customer.fax", "customer.email", "customer.website", "contact.title", "contact.first_name", "contact.middle_name", "contact.last_name", "contact.full_name", "notes" ] end |
.options_for_select ⇒ Object
52 53 54 |
# File 'app/models/data_dictionary_set.rb', line 52 def self. order(:set_name, :destination).map { |o| [o.set_name, o.id] } end |
Instance Method Details
#data_dictionaries ⇒ ActiveRecord::Relation<DataDictionary>
16 |
# File 'app/models/data_dictionary_set.rb', line 16 has_many :data_dictionaries |
#data_import_column ⇒ ActiveRecord::Relation<DataImportColumn>
15 |
# File 'app/models/data_dictionary_set.rb', line 15 has_many :data_import_column |
#options_for_destination ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/models/data_dictionary_set.rb', line 56 def case destination when 'billing_address.country_iso3' Country.countries_for_select when 'customer.profile_id' Profile. when 'customer.primary_sales_rep_id' Employee. when 'customer.buying_group_id' BuyingGroup. when 'customer.tier2_program_pricing_id' Coupon. end end |