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
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 Models::EventPublishable
Class Method Details
.destination_options_for_select ⇒ Object
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 51 |
# File 'app/models/data_dictionary_set.rb', line 24 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
53 54 55 |
# File 'app/models/data_dictionary_set.rb', line 53 def self. all.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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/models/data_dictionary_set.rb', line 57 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 |