magic_model_generator 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +0 -0
- data/README +3 -0
- data/Rakefile +96 -0
- data/examples/singleview/account.rb +94 -0
- data/examples/singleview/account_history.rb +21 -0
- data/examples/singleview/account_reservation.rb +26 -0
- data/examples/singleview/account_type.rb +54 -0
- data/examples/singleview/account_type_aging.rb +17 -0
- data/examples/singleview/account_type_variable.rb +8 -0
- data/examples/singleview/address.rb +8 -0
- data/examples/singleview/address_format.rb +49 -0
- data/examples/singleview/address_history.rb +28 -0
- data/examples/singleview/adjustment.rb +97 -0
- data/examples/singleview/adjustment_batch.rb +42 -0
- data/examples/singleview/adjustment_invoice.rb +17 -0
- data/examples/singleview/adjustment_type.rb +54 -0
- data/examples/singleview/adjustment_type_variable.rb +8 -0
- data/examples/singleview/archive_lock_t.rb +11 -0
- data/examples/singleview/archive_result.rb +15 -0
- data/examples/singleview/archive_type.rb +31 -0
- data/examples/singleview/archive_type_table_list.rb +15 -0
- data/examples/singleview/atai_error_name.rb +7 -0
- data/examples/singleview/atlanta_form.rb +23 -0
- data/examples/singleview/atlanta_form_field.rb +12 -0
- data/examples/singleview/atlanta_group.rb +285 -0
- data/examples/singleview/atlanta_help_entry.rb +32 -0
- data/examples/singleview/atlanta_operator.rb +356 -0
- data/examples/singleview/atlanta_profile.rb +47 -0
- data/examples/singleview/atlanta_profile_func_map.rb +8 -0
- data/examples/singleview/atlanta_profile_group_map.rb +10 -0
- data/examples/singleview/atlanta_profile_role_map.rb +8 -0
- data/examples/singleview/atlanta_profile_wf_map.rb +10 -0
- data/examples/singleview/atlanta_role.rb +23 -0
- data/examples/singleview/atlanta_table_partition.rb +39 -0
- data/examples/singleview/attribute_type.rb +75 -0
- data/examples/singleview/attribute_type_variable.rb +8 -0
- data/examples/singleview/bill_run.rb +93 -0
- data/examples/singleview/bill_run_operation.rb +54 -0
- data/examples/singleview/bill_run_type.rb +39 -0
- data/examples/singleview/bill_run_type_status.rb +12 -0
- data/examples/singleview/bill_run_type_task.rb +12 -0
- data/examples/singleview/cache.rb +23 -0
- data/examples/singleview/cache_field.rb +13 -0
- data/examples/singleview/can_act_charge.rb +16 -0
- data/examples/singleview/charge.rb +67 -0
- data/examples/singleview/charge_category.rb +45 -0
- data/examples/singleview/charge_output_defn.rb +13 -0
- data/examples/singleview/charge_output_defn_history.rb +22 -0
- data/examples/singleview/charge_output_defn_var.rb +10 -0
- data/examples/singleview/configuration_attr_type.rb +22 -0
- data/examples/singleview/configuration_attribute.rb +11 -0
- data/examples/singleview/configuration_item.rb +26 -0
- data/examples/singleview/configuration_item_type.rb +29 -0
- data/examples/singleview/contract.rb +35 -0
- data/examples/singleview/contract_history.rb +48 -0
- data/examples/singleview/contract_type.rb +58 -0
- data/examples/singleview/contract_type_product.rb +11 -0
- data/examples/singleview/conversion_rate.rb +14 -0
- data/examples/singleview/currency.rb +118 -0
- data/examples/singleview/currency_history.rb +28 -0
- data/examples/singleview/customer_contact.rb +12 -0
- data/examples/singleview/customer_node.rb +166 -0
- data/examples/singleview/customer_node_bill_run.rb +12 -0
- data/examples/singleview/customer_node_charge_cat.rb +22 -0
- data/examples/singleview/customer_node_correspond.rb +12 -0
- data/examples/singleview/customer_node_da.rb +11 -0
- data/examples/singleview/customer_node_da_array.rb +35 -0
- data/examples/singleview/customer_node_history.rb +86 -0
- data/examples/singleview/customer_node_inv_format.rb +33 -0
- data/examples/singleview/customer_node_type.rb +89 -0
- data/examples/singleview/customer_node_type_cc.rb +18 -0
- data/examples/singleview/customer_node_type_da.rb +8 -0
- data/examples/singleview/customer_node_type_var.rb +8 -0
- data/examples/singleview/customer_query.rb +80 -0
- data/examples/singleview/customer_query_progress.rb +20 -0
- data/examples/singleview/customer_query_type.rb +49 -0
- data/examples/singleview/customer_query_type_var.rb +8 -0
- data/examples/singleview/delete_cascade.rb +13 -0
- data/examples/singleview/delete_cascade_group.rb +21 -0
- data/examples/singleview/delete_constraint.rb +9 -0
- data/examples/singleview/derived_attribute.rb +32 -0
- data/examples/singleview/derived_attribute_array.rb +32 -0
- data/examples/singleview/derived_attribute_history.rb +41 -0
- data/examples/singleview/derived_attribute_index.rb +13 -0
- data/examples/singleview/derived_attribute_value.rb +19 -0
- data/examples/singleview/dil.rb +18 -0
- data/examples/singleview/dil_history.rb +24 -0
- data/examples/singleview/dil_reference.rb +9 -0
- data/examples/singleview/dil_validation_t.rb +6 -0
- data/examples/singleview/dil_variable.rb +10 -0
- data/examples/singleview/dunning_t.rb +14 -0
- data/examples/singleview/entity_mapping.rb +11 -0
- data/examples/singleview/entity_remap.rb +22 -0
- data/examples/singleview/entity_validation.rb +70 -0
- data/examples/singleview/entity_validation_list.rb +15 -0
- data/examples/singleview/entity_validation_variable.rb +8 -0
- data/examples/singleview/equipment.rb +28 -0
- data/examples/singleview/equipment_history.rb +62 -0
- data/examples/singleview/equipment_type.rb +57 -0
- data/examples/singleview/equipment_type_variable.rb +8 -0
- data/examples/singleview/error_group.rb +18 -0
- data/examples/singleview/error_message.rb +65 -0
- data/examples/singleview/evs_address_equiv.rb +17 -0
- data/examples/singleview/evs_alias.rb +12 -0
- data/examples/singleview/evs_attribute_type_key.rb +7 -0
- data/examples/singleview/evt_equipment_changeover.rb +9 -0
- data/examples/singleview/expression_list.rb +27 -0
- data/examples/singleview/expression_list_value.rb +17 -0
- data/examples/singleview/fac_group_compatibility.rb +11 -0
- data/examples/singleview/fac_group_instance.rb +19 -0
- data/examples/singleview/fac_group_instance_hist.rb +16 -0
- data/examples/singleview/facility.rb +9 -0
- data/examples/singleview/facility_group.rb +21 -0
- data/examples/singleview/facility_group_history.rb +21 -0
- data/examples/singleview/foreign_key.rb +9 -0
- data/examples/singleview/function_defn.rb +16 -0
- data/examples/singleview/function_defn_history.rb +35 -0
- data/examples/singleview/function_role.rb +24 -0
- data/examples/singleview/function_role_map.rb +10 -0
- data/examples/singleview/gl_code.rb +65 -0
- data/examples/singleview/gl_code_history.rb +20 -0
- data/examples/singleview/gl_upload.rb +10 -0
- data/examples/singleview/icon.rb +64 -0
- data/examples/singleview/inv_loop_t.rb +4 -0
- data/examples/singleview/inv_report_accounts_t.rb +25 -0
- data/examples/singleview/invoice.rb +134 -0
- data/examples/singleview/invoice_contents.rb +14 -0
- data/examples/singleview/invoice_format.rb +31 -0
- data/examples/singleview/invoice_format_history.rb +29 -0
- data/examples/singleview/invoice_message.rb +17 -0
- data/examples/singleview/invoice_message_history.rb +31 -0
- data/examples/singleview/invoice_message_variable.rb +10 -0
- data/examples/singleview/invoice_receivable_type.rb +13 -0
- data/examples/singleview/invoice_type.rb +23 -0
- data/examples/singleview/invoice_type_history.rb +26 -0
- data/examples/singleview/invoice_type_variable.rb +10 -0
- data/examples/singleview/isp_email_address.rb +17 -0
- data/examples/singleview/licence_current_values.rb +12 -0
- data/examples/singleview/menu_role_map.rb +10 -0
- data/examples/singleview/normalised_event.rb +119 -0
- data/examples/singleview/normalised_event_error.rb +91 -0
- data/examples/singleview/normalised_event_file.rb +75 -0
- data/examples/singleview/normalised_event_ft.rb +18 -0
- data/examples/singleview/normalised_event_ft_hist.rb +25 -0
- data/examples/singleview/normalised_event_ft_var.rb +10 -0
- data/examples/singleview/normalised_event_type.rb +54 -0
- data/examples/singleview/output_device.rb +37 -0
- data/examples/singleview/output_method.rb +32 -0
- data/examples/singleview/output_method_type.rb +38 -0
- data/examples/singleview/output_select.rb +17 -0
- data/examples/singleview/payment.rb +102 -0
- data/examples/singleview/payment_batch.rb +43 -0
- data/examples/singleview/payment_invoice.rb +17 -0
- data/examples/singleview/payment_item.rb +15 -0
- data/examples/singleview/payment_type.rb +57 -0
- data/examples/singleview/payment_type_variable.rb +8 -0
- data/examples/singleview/person.rb +60 -0
- data/examples/singleview/person_history.rb +69 -0
- data/examples/singleview/person_type.rb +39 -0
- data/examples/singleview/plan_table.rb +27 -0
- data/examples/singleview/product.rb +45 -0
- data/examples/singleview/product_compatibility.rb +13 -0
- data/examples/singleview/product_derived_attribute.rb +10 -0
- data/examples/singleview/product_facility_group.rb +16 -0
- data/examples/singleview/product_group.rb +12 -0
- data/examples/singleview/product_group_history.rb +20 -0
- data/examples/singleview/product_history.rb +35 -0
- data/examples/singleview/product_in_product_group.rb +12 -0
- data/examples/singleview/product_instance.rb +41 -0
- data/examples/singleview/product_instance_equip.rb +21 -0
- data/examples/singleview/product_instance_history.rb +37 -0
- data/examples/singleview/product_instance_service.rb +17 -0
- data/examples/singleview/product_payment_item.rb +19 -0
- data/examples/singleview/product_service_type.rb +32 -0
- data/examples/singleview/product_service_type_equip.rb +20 -0
- data/examples/singleview/product_subtotal.rb +14 -0
- data/examples/singleview/product_tariff.rb +16 -0
- data/examples/singleview/racr_clec_t1.rb +12 -0
- data/examples/singleview/racr_clec_t2.rb +12 -0
- data/examples/singleview/racr_clec_t3.rb +28 -0
- data/examples/singleview/racr_t.rb +29 -0
- data/examples/singleview/ragd_clec_t.rb +47 -0
- data/examples/singleview/ragd_t.rb +28 -0
- data/examples/singleview/rapc_t.rb +27 -0
- data/examples/singleview/rdfd_cmn_t.rb +17 -0
- data/examples/singleview/rdfd_t.rb +16 -0
- data/examples/singleview/receivable_type.rb +49 -0
- data/examples/singleview/receivable_type_history.rb +25 -0
- data/examples/singleview/reference_code.rb +17 -0
- data/examples/singleview/reference_type.rb +32 -0
- data/examples/singleview/release_info.rb +10 -0
- data/examples/singleview/report_reference_type.rb +14 -0
- data/examples/singleview/report_reference_type_defs.rb +12 -0
- data/examples/singleview/reprocessed_file.rb +32 -0
- data/examples/singleview/rgp_file.rb +22 -0
- data/examples/singleview/rgp_normalised_event.rb +78 -0
- data/examples/singleview/rmag_t.rb +32 -0
- data/examples/singleview/rpmr_t.rb +27 -0
- data/examples/singleview/rpsi_t.rb +24 -0
- data/examples/singleview/rser_t.rb +13 -0
- data/examples/singleview/rshu_cmn_t.rb +31 -0
- data/examples/singleview/schedule.rb +91 -0
- data/examples/singleview/schedule_task_type.rb +43 -0
- data/examples/singleview/service.rb +88 -0
- data/examples/singleview/service_bill_run_t.rb +12 -0
- data/examples/singleview/service_charge_category.rb +22 -0
- data/examples/singleview/service_da.rb +11 -0
- data/examples/singleview/service_da_array.rb +35 -0
- data/examples/singleview/service_duplicate.rb +4 -0
- data/examples/singleview/service_history.rb +59 -0
- data/examples/singleview/service_type.rb +54 -0
- data/examples/singleview/service_type_cc.rb +18 -0
- data/examples/singleview/service_type_da.rb +8 -0
- data/examples/singleview/service_type_equip_type.rb +11 -0
- data/examples/singleview/subtotal.rb +48 -0
- data/examples/singleview/subtotal_history.rb +59 -0
- data/examples/singleview/subtotal_rating_delta.rb +20 -0
- data/examples/singleview/subtotal_rating_value.rb +21 -0
- data/examples/singleview/subtotal_term.rb +16 -0
- data/examples/singleview/subtotal_value.rb +18 -0
- data/examples/singleview/summary_of_change.rb +31 -0
- data/examples/singleview/summary_of_change_ev.rb +18 -0
- data/examples/singleview/summary_of_change_view.rb +22 -0
- data/examples/singleview/t2_anumber_france.rb +22 -0
- data/examples/singleview/t2_anumber_italy.rb +22 -0
- data/examples/singleview/t2_anumber_netherlands.rb +24 -0
- data/examples/singleview/t2_anumber_portugal.rb +22 -0
- data/examples/singleview/t2_anumber_spain.rb +22 -0
- data/examples/singleview/t2_anumber_switzerland.rb +24 -0
- data/examples/singleview/t2_bankreference_austria.rb +7 -0
- data/examples/singleview/t2_bankreference_belgium.rb +6 -0
- data/examples/singleview/t2_bankreference_france.rb +7 -0
- data/examples/singleview/t2_bankreference_germany.rb +7 -0
- data/examples/singleview/t2_bankreference_italy.rb +7 -0
- data/examples/singleview/t2_bankreference_portugal.rb +7 -0
- data/examples/singleview/t2_cc_provrequests.rb +19 -0
- data/examples/singleview/t2_emf_info.rb +12 -0
- data/examples/singleview/t2_ev_column_label_mapping.rb +9 -0
- data/examples/singleview/t2_historytable.rb +26 -0
- data/examples/singleview/t2_inv_revoked_invoice.rb +11 -0
- data/examples/singleview/t2_inv_suppress_invoice.rb +13 -0
- data/examples/singleview/t2_national_number_plan.rb +8 -0
- data/examples/singleview/t2_pay_statement.rb +28 -0
- data/examples/singleview/t2_prov_req_action.rb +22 -0
- data/examples/singleview/t2_prov_request.rb +32 -0
- data/examples/singleview/t2_rep_brr_t.rb +19 -0
- data/examples/singleview/t2_rep_trr_t.rb +19 -0
- data/examples/singleview/t2_rep_ubr_t.rb +19 -0
- data/examples/singleview/t2_taxclass.rb +8 -0
- data/examples/singleview/t2_zipcode_austria.rb +8 -0
- data/examples/singleview/t2_zipcode_france.rb +8 -0
- data/examples/singleview/t2_zipcode_germany.rb +8 -0
- data/examples/singleview/t2_zipcode_hungary.rb +8 -0
- data/examples/singleview/t2_zipcode_luxembourg.rb +8 -0
- data/examples/singleview/t2_zipcode_netherlands.rb +8 -0
- data/examples/singleview/t2_zipcode_portugal.rb +9 -0
- data/examples/singleview/t2_zipcode_spain.rb +8 -0
- data/examples/singleview/t2_zipcode_switzerland.rb +8 -0
- data/examples/singleview/table_import_order.rb +6 -0
- data/examples/singleview/tariff.rb +51 -0
- data/examples/singleview/tariff_charge.rb +33 -0
- data/examples/singleview/tariff_charge_defn.rb +18 -0
- data/examples/singleview/tariff_condition_defn.rb +19 -0
- data/examples/singleview/tariff_history.rb +70 -0
- data/examples/singleview/tariff_recurring.rb +36 -0
- data/examples/singleview/task_queue.rb +130 -0
- data/examples/singleview/task_queue_result.rb +10 -0
- data/examples/singleview/template.rb +18 -0
- data/examples/singleview/template_history.rb +30 -0
- data/examples/singleview/template_reference.rb +9 -0
- data/examples/singleview/template_variable.rb +10 -0
- data/examples/singleview/trt_clec_treatment.rb +13 -0
- data/examples/singleview/variable_defn.rb +48 -0
- data/examples/singleview/variable_defn_dependency.rb +11 -0
- data/examples/singleview/variable_defn_direct.rb +15 -0
- data/examples/singleview/variable_defn_history.rb +22 -0
- data/examples/singleview/work_force.rb +25 -0
- data/examples/singleview/xpsi_addr_val_commtax21.rb +24 -0
- data/examples/singleview/xpsi_addr_val_msag.rb +24 -0
- data/examples/singleview/xpsi_addr_val_zip.rb +14 -0
- data/examples/singleview/xpsi_ne_batch.rb +20 -0
- data/examples/singleview/xpsi_product_batch.rb +18 -0
- data/examples/singleview/xpsi_product_status.rb +14 -0
- data/examples/singleview/xpsi_tax_error.rb +34 -0
- data/examples/singleview/xpsi_trt_revoke.rb +68 -0
- data/examples/singleview/xpsi_trt_revoke_prod_inst.rb +12 -0
- data/examples/singleview/xpsi_update_capture.rb +35 -0
- data/lib/activerecord/base.rb +12 -0
- data/lib/hash_tricks.rb +21 -0
- data/lib/magic_model_generator.rb +8 -0
- data/lib/magic_model_generator/schema.rb +205 -0
- data/lib/magic_model_generator/validations.rb +48 -0
- data/lib/magic_model_generator/version.rb +9 -0
- data/lib/rails/generator/dynamic_named_base.rb +99 -0
- data/lib/rails/generator/manifest.rb +8 -0
- data/magic_model_generator.rb +88 -0
- data/templates/model.rb +3 -0
- data/test/magic_model_generator_test.rb +11 -0
- data/test/test_helper.rb +2 -0
- metadata +366 -0
data/CHANGELOG
ADDED
File without changes
|
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rake/packagetask'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
require 'rake/contrib/rubyforgepublisher'
|
9
|
+
require 'fileutils'
|
10
|
+
include FileUtils
|
11
|
+
require File.join(File.dirname(__FILE__), 'lib', 'magic_model_generator', 'version')
|
12
|
+
|
13
|
+
AUTHOR = "Dr Nic Williams"
|
14
|
+
EMAIL = "drnicwilliams@gmail.com"
|
15
|
+
DESCRIPTION = "Generates Rails models from the target database... magically! Validations and associations included."
|
16
|
+
RUBYFORGE_PROJECT = "magicmodels"
|
17
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
18
|
+
BIN_FILES = %w( )
|
19
|
+
RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
|
20
|
+
|
21
|
+
|
22
|
+
NAME = "magic_model_generator"
|
23
|
+
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
24
|
+
VERS = ENV['VERSION'] || (MagicModelsGenerator::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
25
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
26
|
+
RDOC_OPTS = ['--quiet', '--title', "magic_model_generator documentation",
|
27
|
+
"--opname", "index.html",
|
28
|
+
"--line-numbers",
|
29
|
+
"--main", "README",
|
30
|
+
"--inline-source"]
|
31
|
+
|
32
|
+
desc "Packages up magic_model_generator gem."
|
33
|
+
task :default => [:test]
|
34
|
+
task :package => [:clean]
|
35
|
+
|
36
|
+
Rake::TestTask.new("test") { |t|
|
37
|
+
t.libs << "test"
|
38
|
+
t.pattern = "test/**/*_test.rb"
|
39
|
+
t.verbose = true
|
40
|
+
}
|
41
|
+
|
42
|
+
spec =
|
43
|
+
Gem::Specification.new do |s|
|
44
|
+
s.name = NAME
|
45
|
+
s.version = VERS
|
46
|
+
s.platform = Gem::Platform::RUBY
|
47
|
+
s.has_rdoc = true
|
48
|
+
s.extra_rdoc_files = ["README", "CHANGELOG"]
|
49
|
+
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
|
50
|
+
s.summary = DESCRIPTION
|
51
|
+
s.description = DESCRIPTION
|
52
|
+
s.author = AUTHOR
|
53
|
+
s.email = EMAIL
|
54
|
+
s.homepage = HOMEPATH
|
55
|
+
s.executables = BIN_FILES
|
56
|
+
s.rubyforge_project = RUBYFORGE_PROJECT
|
57
|
+
s.bindir = "bin"
|
58
|
+
s.require_path = "lib"
|
59
|
+
s.autorequire = "magic_model_generator"
|
60
|
+
|
61
|
+
s.add_dependency('dr_nic_magic_models', '>=0.9.0')
|
62
|
+
s.required_ruby_version = '>= 1.8.4'
|
63
|
+
|
64
|
+
s.files = %w(README CHANGELOG Rakefile ) + [NAME + '.rb'] +
|
65
|
+
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
|
66
|
+
Dir.glob("ext/**/*.{h,c,rb}") +
|
67
|
+
Dir.glob("examples/**/*.rb") +
|
68
|
+
Dir.glob("tools/*.rb")
|
69
|
+
|
70
|
+
# s.extensions = FileList["ext/**/extconf.rb"].to_a
|
71
|
+
end
|
72
|
+
|
73
|
+
Rake::GemPackageTask.new(spec) do |p|
|
74
|
+
p.need_tar = RELEASE_TYPES.include? 'tar'
|
75
|
+
p.need_zip = RELEASE_TYPES.include? 'zip'
|
76
|
+
p.gem_spec = spec
|
77
|
+
end
|
78
|
+
|
79
|
+
task :install => [ :package ] do
|
80
|
+
name = "#{NAME}-#{VERS}.gem"
|
81
|
+
sh %{sudo gem install pkg/#{name}}
|
82
|
+
end
|
83
|
+
|
84
|
+
task :uninstall => [:clean] do
|
85
|
+
sh %{sudo gem uninstall #{NAME}}
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "Publish the release files to RubyForge."
|
89
|
+
task :release => [ :package ] do
|
90
|
+
system('rubyforge login')
|
91
|
+
for ext in RELEASE_TYPES
|
92
|
+
release_command = "rubyforge add_release #{RUBYFORGE_PROJECT} #{NAME} 'REL #{VERS}' pkg/#{NAME}-#{VERS}.#{ext}"
|
93
|
+
puts release_command
|
94
|
+
system(release_command)
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
class Account < ActiveRecord::Base
|
2
|
+
belongs_to :account, :class_name => 'Account', :foreign_key => :account_id
|
3
|
+
belongs_to :customer_node, :class_name => 'CustomerNode', :foreign_key => :customer_node_id
|
4
|
+
belongs_to :account_type, :class_name => 'AccountType', :foreign_key => :account_type_id
|
5
|
+
belongs_to :invoice, :class_name => 'Invoice', :foreign_key => :invoice_id
|
6
|
+
has_many :accounts, :class_name => 'Account', :foreign_key => :account_id
|
7
|
+
has_many :account_histories, :class_name => 'AccountHistory', :foreign_key => :account_id
|
8
|
+
has_many :account_reservations, :class_name => 'AccountReservation', :foreign_key => :account_id
|
9
|
+
has_many :adjustment_invoices, :class_name => 'AdjustmentInvoice', :foreign_key => :account_id
|
10
|
+
has_many :charges, :class_name => 'Charge', :foreign_key => :account_id
|
11
|
+
has_many :customer_node_inv_formats, :class_name => 'CustomerNodeInvFormat', :foreign_key => :account_id
|
12
|
+
has_many :customer_queries, :class_name => 'CustomerQuery', :foreign_key => :account_id
|
13
|
+
has_many :gl_uploads, :class_name => 'GlUpload', :foreign_key => :account_id
|
14
|
+
has_many :inv_report_accounts_ts, :class_name => 'InvReportAccountsT', :foreign_key => :account_id
|
15
|
+
has_many :invoices, :class_name => 'Invoice', :foreign_key => :account_id
|
16
|
+
has_many :payment_invoices, :class_name => 'PaymentInvoice', :foreign_key => :account_id
|
17
|
+
has_many :racr_clec_t1s, :class_name => 'RacrClecT1', :foreign_key => :account_id
|
18
|
+
has_many :racr_clec_t2s, :class_name => 'RacrClecT2', :foreign_key => :account_id
|
19
|
+
has_many :receivable_type_histories, :class_name => 'ReceivableTypeHistory', :foreign_key => :account_id
|
20
|
+
has_many :rshu_cmn_ts, :class_name => 'RshuCmnT', :foreign_key => :account_id
|
21
|
+
has_many :customer_nodes, :through => accounts
|
22
|
+
has_many :invoices, :through => accounts
|
23
|
+
has_many :account_types, :through => accounts
|
24
|
+
has_many :adjustments, :through => account_histories
|
25
|
+
has_many :invoices, :through => account_histories
|
26
|
+
has_many :payments, :through => account_histories
|
27
|
+
has_many :invoices, :through => adjustment_invoices
|
28
|
+
has_many :adjustments, :through => adjustment_invoices
|
29
|
+
has_many :receivable_types, :through => adjustment_invoices
|
30
|
+
has_many :subtotals, :through => charges
|
31
|
+
has_many :customer_nodes, :through => charges
|
32
|
+
has_many :invoices, :through => charges
|
33
|
+
has_many :adjustments, :through => charges
|
34
|
+
has_many :currencies, :through => charges
|
35
|
+
has_many :tariffs, :through => charges
|
36
|
+
has_many :services, :through => charges
|
37
|
+
has_many :receivable_types, :through => charges
|
38
|
+
has_many :normalised_events, :through => charges
|
39
|
+
has_many :gl_codes, :through => charges
|
40
|
+
has_many :payments, :through => charges
|
41
|
+
has_many :charges, :through => charges
|
42
|
+
has_many :customer_nodes, :through => customer_node_inv_formats
|
43
|
+
has_many :invoice_formats, :through => customer_node_inv_formats
|
44
|
+
has_many :people, :through => customer_node_inv_formats
|
45
|
+
has_many :atlanta_groups, :through => customer_queries
|
46
|
+
has_many :customer_nodes, :through => customer_queries
|
47
|
+
has_many :customer_query_types, :through => customer_queries
|
48
|
+
has_many :customer_queries, :through => customer_queries
|
49
|
+
has_many :currencies, :through => customer_queries
|
50
|
+
has_many :invoices, :through => customer_queries
|
51
|
+
has_many :atlanta_operators, :through => customer_queries
|
52
|
+
has_many :services, :through => customer_queries
|
53
|
+
has_many :contracts, :through => customer_queries
|
54
|
+
has_many :people, :through => customer_queries
|
55
|
+
has_many :task_queues, :through => gl_uploads
|
56
|
+
has_many :customer_nodes, :through => inv_report_accounts_ts
|
57
|
+
has_many :bill_runs, :through => inv_report_accounts_ts
|
58
|
+
has_many :customer_nodes, :through => invoices
|
59
|
+
has_many :invoices, :through => invoices
|
60
|
+
has_many :bill_runs, :through => invoices
|
61
|
+
has_many :invoice_types, :through => invoices
|
62
|
+
has_many :invoices, :through => payment_invoices
|
63
|
+
has_many :receivable_types, :through => payment_invoices
|
64
|
+
has_many :payments, :through => payment_invoices
|
65
|
+
has_many :task_queues, :through => racr_clec_t1s
|
66
|
+
has_many :task_queues, :through => racr_clec_t2s
|
67
|
+
has_many :atlanta_groups, :through => receivable_type_histories
|
68
|
+
has_many :atlanta_operators, :through => receivable_type_histories
|
69
|
+
has_many :receivable_types, :through => receivable_type_histories
|
70
|
+
has_many :gl_codes, :through => receivable_type_histories
|
71
|
+
has_many :normalised_event_types, :through => rshu_cmn_ts
|
72
|
+
has_many :task_queues, :through => rshu_cmn_ts
|
73
|
+
has_many :services, :through => rshu_cmn_ts
|
74
|
+
validates_presence_of :account_id
|
75
|
+
validates_numericality_of :account_id, :allow_nil => false, :only_integer => true
|
76
|
+
validates_presence_of :account_name
|
77
|
+
validates_length_of :account_name, :allow_nil => false, :maximum => 30
|
78
|
+
validates_presence_of :last_modified
|
79
|
+
validates_presence_of :customer_node_id
|
80
|
+
validates_numericality_of :customer_node_id, :allow_nil => false, :only_integer => true
|
81
|
+
validates_presence_of :account_type_id
|
82
|
+
validates_numericality_of :account_type_id, :allow_nil => false, :only_integer => true
|
83
|
+
validates_presence_of :account_balance
|
84
|
+
validates_numericality_of :account_balance, :allow_nil => false
|
85
|
+
validates_presence_of :balance_date
|
86
|
+
validates_numericality_of :invoice_id, :allow_nil => true, :only_integer => true
|
87
|
+
validates_numericality_of :previous_invoice_id, :allow_nil => true, :only_integer => true
|
88
|
+
validates_numericality_of :credit_limit, :allow_nil => true
|
89
|
+
validates_presence_of :unbilled_amount
|
90
|
+
validates_numericality_of :unbilled_amount, :allow_nil => false
|
91
|
+
validates_numericality_of :account_action_code, :allow_nil => true, :only_integer => true
|
92
|
+
validates_numericality_of :invoice_unbilled_amount, :allow_nil => true
|
93
|
+
validates_numericality_of :invoice_account_id, :allow_nil => true, :only_integer => true
|
94
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AccountHistory < ActiveRecord::Base
|
2
|
+
belongs_to :account, :class_name => 'Account', :foreign_key => :account_id
|
3
|
+
belongs_to :invoice, :class_name => 'Invoice', :foreign_key => :invoice_id
|
4
|
+
belongs_to :payment, :class_name => 'Payment', :foreign_key => :payment_id
|
5
|
+
belongs_to :adjustment, :class_name => 'Adjustment', :foreign_key => :adjustment_id
|
6
|
+
validates_presence_of :account_id
|
7
|
+
validates_numericality_of :account_id, :allow_nil => false, :only_integer => true
|
8
|
+
validates_presence_of :seqnr
|
9
|
+
validates_numericality_of :seqnr, :allow_nil => false, :only_integer => true
|
10
|
+
validates_presence_of :last_modified
|
11
|
+
validates_presence_of :effective_start_date
|
12
|
+
validates_presence_of :effective_end_date
|
13
|
+
validates_presence_of :previous_balance
|
14
|
+
validates_numericality_of :previous_balance, :allow_nil => false
|
15
|
+
validates_presence_of :current_balance
|
16
|
+
validates_numericality_of :current_balance, :allow_nil => false
|
17
|
+
validates_numericality_of :invoice_id, :allow_nil => true, :only_integer => true
|
18
|
+
validates_numericality_of :payment_id, :allow_nil => true, :only_integer => true
|
19
|
+
validates_numericality_of :adjustment_id, :allow_nil => true, :only_integer => true
|
20
|
+
validates_numericality_of :gl_uploaded_ind_code, :allow_nil => true, :only_integer => true
|
21
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class AccountReservation < ActiveRecord::Base
|
2
|
+
belongs_to :account, :class_name => 'Account', :foreign_key => :account_id
|
3
|
+
validates_presence_of :reservation
|
4
|
+
validates_length_of :reservation, :allow_nil => false, :maximum => 40
|
5
|
+
validates_presence_of :account_id
|
6
|
+
validates_numericality_of :account_id, :allow_nil => false, :only_integer => true
|
7
|
+
validates_presence_of :seqnr
|
8
|
+
validates_numericality_of :seqnr, :allow_nil => false, :only_integer => true
|
9
|
+
validates_presence_of :last_modified
|
10
|
+
validates_presence_of :reserved_amount
|
11
|
+
validates_numericality_of :reserved_amount, :allow_nil => false
|
12
|
+
validates_numericality_of :reserved_amount_currency_id, :allow_nil => true, :only_integer => true
|
13
|
+
validates_presence_of :account_reserved_amount
|
14
|
+
validates_numericality_of :account_reserved_amount, :allow_nil => false
|
15
|
+
validates_presence_of :creation_date
|
16
|
+
validates_length_of :general_1, :allow_nil => true, :maximum => 255
|
17
|
+
validates_length_of :general_2, :allow_nil => true, :maximum => 255
|
18
|
+
validates_length_of :general_3, :allow_nil => true, :maximum => 255
|
19
|
+
validates_length_of :general_4, :allow_nil => true, :maximum => 255
|
20
|
+
validates_length_of :general_5, :allow_nil => true, :maximum => 255
|
21
|
+
validates_length_of :general_6, :allow_nil => true, :maximum => 255
|
22
|
+
validates_length_of :general_7, :allow_nil => true, :maximum => 255
|
23
|
+
validates_length_of :general_8, :allow_nil => true, :maximum => 255
|
24
|
+
validates_length_of :general_9, :allow_nil => true, :maximum => 255
|
25
|
+
validates_length_of :general_10, :allow_nil => true, :maximum => 255
|
26
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class AccountType < ActiveRecord::Base
|
2
|
+
belongs_to :account_type, :class_name => 'AccountType', :foreign_key => :account_type_id
|
3
|
+
belongs_to :atlanta_operator, :class_name => 'AtlantaOperator', :foreign_key => :atlanta_operator_id
|
4
|
+
belongs_to :atlanta_group, :class_name => 'AtlantaGroup', :foreign_key => :atlanta_group_id
|
5
|
+
belongs_to :currency, :class_name => 'Currency', :foreign_key => :currency_id
|
6
|
+
belongs_to :invoice_type, :class_name => 'InvoiceType', :foreign_key => :invoice_type_id
|
7
|
+
has_many :accounts, :class_name => 'Account', :foreign_key => :account_type_id
|
8
|
+
has_many :account_types, :class_name => 'AccountType', :foreign_key => :account_type_id
|
9
|
+
has_many :account_type_agings, :class_name => 'AccountTypeAging', :foreign_key => :account_type_id
|
10
|
+
has_many :account_type_variables, :class_name => 'AccountTypeVariable', :foreign_key => :account_type_id
|
11
|
+
has_many :invoice_message_histories, :class_name => 'InvoiceMessageHistory', :foreign_key => :account_type_id
|
12
|
+
has_many :customer_nodes, :through => accounts
|
13
|
+
has_many :invoices, :through => accounts
|
14
|
+
has_many :accounts, :through => accounts
|
15
|
+
has_many :atlanta_groups, :through => account_types
|
16
|
+
has_many :currencies, :through => account_types
|
17
|
+
has_many :atlanta_operators, :through => account_types
|
18
|
+
has_many :invoice_types, :through => account_types
|
19
|
+
has_many :variable_defns, :through => account_type_variables
|
20
|
+
has_many :atlanta_groups, :through => invoice_message_histories
|
21
|
+
has_many :customer_nodes, :through => invoice_message_histories
|
22
|
+
has_many :task_queues, :through => invoice_message_histories
|
23
|
+
has_many :atlanta_operators, :through => invoice_message_histories
|
24
|
+
has_many :invoice_formats, :through => invoice_message_histories
|
25
|
+
has_many :schedules, :through => invoice_message_histories
|
26
|
+
has_many :invoice_messages, :through => invoice_message_histories
|
27
|
+
validates_presence_of :account_type_id
|
28
|
+
validates_numericality_of :account_type_id, :allow_nil => false, :only_integer => true
|
29
|
+
validates_presence_of :last_modified
|
30
|
+
validates_presence_of :account_type_name
|
31
|
+
validates_length_of :account_type_name, :allow_nil => false, :maximum => 30
|
32
|
+
validates_presence_of :description
|
33
|
+
validates_length_of :description, :allow_nil => false, :maximum => 255
|
34
|
+
validates_presence_of :atlanta_operator_id
|
35
|
+
validates_numericality_of :atlanta_operator_id, :allow_nil => false, :only_integer => true
|
36
|
+
validates_presence_of :atlanta_group_id
|
37
|
+
validates_numericality_of :atlanta_group_id, :allow_nil => false, :only_integer => true
|
38
|
+
validates_presence_of :account_class_code
|
39
|
+
validates_numericality_of :account_class_code, :allow_nil => false, :only_integer => true
|
40
|
+
validates_presence_of :account_category_code
|
41
|
+
validates_numericality_of :account_category_code, :allow_nil => false, :only_integer => true
|
42
|
+
validates_presence_of :asset_increase_prompt
|
43
|
+
validates_length_of :asset_increase_prompt, :allow_nil => false, :maximum => 40
|
44
|
+
validates_presence_of :asset_decrease_prompt
|
45
|
+
validates_length_of :asset_decrease_prompt, :allow_nil => false, :maximum => 40
|
46
|
+
validates_presence_of :currency_id
|
47
|
+
validates_numericality_of :currency_id, :allow_nil => false, :only_integer => true
|
48
|
+
validates_presence_of :account_format_expr
|
49
|
+
validates_length_of :account_format_expr, :allow_nil => false, :maximum => 255
|
50
|
+
validates_presence_of :invoice_type_id
|
51
|
+
validates_numericality_of :invoice_type_id, :allow_nil => false, :only_integer => true
|
52
|
+
validates_numericality_of :account_reservation_ev_id, :allow_nil => true, :only_integer => true
|
53
|
+
validates_length_of :version_str, :allow_nil => true, :maximum => 255
|
54
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class AccountTypeAging < ActiveRecord::Base
|
2
|
+
belongs_to :account_type, :class_name => 'AccountType', :foreign_key => :account_type_id
|
3
|
+
validates_presence_of :account_type_id
|
4
|
+
validates_numericality_of :account_type_id, :allow_nil => false, :only_integer => true
|
5
|
+
validates_presence_of :display_seqnr
|
6
|
+
validates_numericality_of :display_seqnr, :allow_nil => false, :only_integer => true
|
7
|
+
validates_presence_of :last_modified
|
8
|
+
validates_presence_of :evaluation_seqnr
|
9
|
+
validates_numericality_of :evaluation_seqnr, :allow_nil => false, :only_integer => true
|
10
|
+
validates_presence_of :label
|
11
|
+
validates_length_of :label, :allow_nil => false, :maximum => 40
|
12
|
+
validates_numericality_of :foreground_colour, :allow_nil => true, :only_integer => true
|
13
|
+
validates_numericality_of :background_colour, :allow_nil => true, :only_integer => true
|
14
|
+
validates_presence_of :aged_classification_expr
|
15
|
+
validates_length_of :aged_classification_expr, :allow_nil => false, :maximum => 255
|
16
|
+
validates_length_of :description, :allow_nil => true, :maximum => 255
|
17
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AccountTypeVariable < ActiveRecord::Base
|
2
|
+
belongs_to :account_type, :class_name => 'AccountType', :foreign_key => :account_type_id
|
3
|
+
belongs_to :variable_defn, :class_name => 'VariableDefn', :foreign_key => :variable_defn_id
|
4
|
+
validates_presence_of :account_type_id
|
5
|
+
validates_numericality_of :account_type_id, :allow_nil => false, :only_integer => true
|
6
|
+
validates_presence_of :variable_defn_id
|
7
|
+
validates_numericality_of :variable_defn_id, :allow_nil => false, :only_integer => true
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class Address < ActiveRecord::Base
|
2
|
+
validates_presence_of :address_id
|
3
|
+
validates_numericality_of :address_id, :allow_nil => false, :only_integer => true
|
4
|
+
validates_presence_of :reference_count
|
5
|
+
validates_numericality_of :reference_count, :allow_nil => false, :only_integer => true
|
6
|
+
validates_presence_of :history_count
|
7
|
+
validates_numericality_of :history_count, :allow_nil => false, :only_integer => true
|
8
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class AddressFormat < ActiveRecord::Base
|
2
|
+
belongs_to :address_format, :class_name => 'AddressFormat', :foreign_key => :address_format_id
|
3
|
+
belongs_to :atlanta_operator, :class_name => 'AtlantaOperator', :foreign_key => :atlanta_operator_id
|
4
|
+
belongs_to :atlanta_group, :class_name => 'AtlantaGroup', :foreign_key => :atlanta_group_id
|
5
|
+
belongs_to :entity_validation, :class_name => 'EntityValidation', :foreign_key => :entity_validation_id
|
6
|
+
has_many :address_formats, :class_name => 'AddressFormat', :foreign_key => :address_format_id
|
7
|
+
has_many :customer_node_types, :class_name => 'CustomerNodeType', :foreign_key => :address_format_id
|
8
|
+
has_many :equipment_types, :class_name => 'EquipmentType', :foreign_key => :address_format_id
|
9
|
+
has_many :person_types, :class_name => 'PersonType', :foreign_key => :address_format_id
|
10
|
+
has_many :service_types, :class_name => 'ServiceType', :foreign_key => :address_format_id
|
11
|
+
has_many :atlanta_groups, :through => address_formats
|
12
|
+
has_many :atlanta_operators, :through => address_formats
|
13
|
+
has_many :entity_validations, :through => address_formats
|
14
|
+
has_many :atlanta_groups, :through => customer_node_types
|
15
|
+
has_many :icons, :through => customer_node_types
|
16
|
+
has_many :atlanta_operators, :through => customer_node_types
|
17
|
+
has_many :customer_node_types, :through => customer_node_types
|
18
|
+
has_many :invoice_formats, :through => customer_node_types
|
19
|
+
has_many :gl_codes, :through => customer_node_types
|
20
|
+
has_many :atlanta_groups, :through => equipment_types
|
21
|
+
has_many :icons, :through => equipment_types
|
22
|
+
has_many :atlanta_operators, :through => equipment_types
|
23
|
+
has_many :equipment_types, :through => equipment_types
|
24
|
+
has_many :atlanta_groups, :through => person_types
|
25
|
+
has_many :icons, :through => person_types
|
26
|
+
has_many :atlanta_operators, :through => person_types
|
27
|
+
has_many :person_types, :through => person_types
|
28
|
+
has_many :entity_validations, :through => person_types
|
29
|
+
has_many :atlanta_groups, :through => service_types
|
30
|
+
has_many :icons, :through => service_types
|
31
|
+
has_many :atlanta_operators, :through => service_types
|
32
|
+
has_many :service_types, :through => service_types
|
33
|
+
has_many :gl_codes, :through => service_types
|
34
|
+
validates_presence_of :address_format_id
|
35
|
+
validates_numericality_of :address_format_id, :allow_nil => false, :only_integer => true
|
36
|
+
validates_presence_of :address_format_name
|
37
|
+
validates_length_of :address_format_name, :allow_nil => false, :maximum => 30
|
38
|
+
validates_presence_of :description
|
39
|
+
validates_length_of :description, :allow_nil => false, :maximum => 255
|
40
|
+
validates_presence_of :last_modified
|
41
|
+
validates_presence_of :atlanta_operator_id
|
42
|
+
validates_numericality_of :atlanta_operator_id, :allow_nil => false, :only_integer => true
|
43
|
+
validates_presence_of :atlanta_group_id
|
44
|
+
validates_numericality_of :atlanta_group_id, :allow_nil => false, :only_integer => true
|
45
|
+
validates_presence_of :address_style_code
|
46
|
+
validates_numericality_of :address_style_code, :allow_nil => false, :only_integer => true
|
47
|
+
validates_numericality_of :entity_validation_id, :allow_nil => true, :only_integer => true
|
48
|
+
validates_length_of :version_str, :allow_nil => true, :maximum => 255
|
49
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class AddressHistory < ActiveRecord::Base
|
2
|
+
validates_presence_of :address_id
|
3
|
+
validates_numericality_of :address_id, :allow_nil => false, :only_integer => true
|
4
|
+
validates_presence_of :last_modified
|
5
|
+
validates_presence_of :effective_start_date
|
6
|
+
validates_presence_of :effective_end_date
|
7
|
+
validates_length_of :line_1, :allow_nil => true, :maximum => 80
|
8
|
+
validates_length_of :line_2, :allow_nil => true, :maximum => 80
|
9
|
+
validates_length_of :suburb, :allow_nil => true, :maximum => 80
|
10
|
+
validates_length_of :city, :allow_nil => true, :maximum => 80
|
11
|
+
validates_length_of :post_code, :allow_nil => true, :maximum => 10
|
12
|
+
validates_length_of :state, :allow_nil => true, :maximum => 80
|
13
|
+
validates_length_of :country, :allow_nil => true, :maximum => 80
|
14
|
+
validates_length_of :geocode, :allow_nil => true, :maximum => 80
|
15
|
+
validates_numericality_of :xpos, :allow_nil => true
|
16
|
+
validates_numericality_of :ypos, :allow_nil => true
|
17
|
+
validates_numericality_of :zpos, :allow_nil => true
|
18
|
+
validates_length_of :general_1, :allow_nil => true, :maximum => 255
|
19
|
+
validates_length_of :general_2, :allow_nil => true, :maximum => 255
|
20
|
+
validates_length_of :general_3, :allow_nil => true, :maximum => 255
|
21
|
+
validates_length_of :general_4, :allow_nil => true, :maximum => 255
|
22
|
+
validates_length_of :general_5, :allow_nil => true, :maximum => 255
|
23
|
+
validates_length_of :general_6, :allow_nil => true, :maximum => 255
|
24
|
+
validates_length_of :general_7, :allow_nil => true, :maximum => 255
|
25
|
+
validates_length_of :general_8, :allow_nil => true, :maximum => 255
|
26
|
+
validates_length_of :general_9, :allow_nil => true, :maximum => 255
|
27
|
+
validates_length_of :general_10, :allow_nil => true, :maximum => 255
|
28
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
class Adjustment < ActiveRecord::Base
|
2
|
+
belongs_to :adjustment, :class_name => 'Adjustment', :foreign_key => :adjustment_id
|
3
|
+
belongs_to :adjustment_batch, :class_name => 'AdjustmentBatch', :foreign_key => :adjustment_batch_id
|
4
|
+
belongs_to :adjustment_type, :class_name => 'AdjustmentType', :foreign_key => :adjustment_type_id
|
5
|
+
belongs_to :invoice, :class_name => 'Invoice', :foreign_key => :invoice_id
|
6
|
+
belongs_to :atlanta_operator, :class_name => 'AtlantaOperator', :foreign_key => :atlanta_operator_id
|
7
|
+
belongs_to :currency, :class_name => 'Currency', :foreign_key => :currency_id
|
8
|
+
belongs_to :customer_query, :class_name => 'CustomerQuery', :foreign_key => :customer_query_id
|
9
|
+
has_many :account_histories, :class_name => 'AccountHistory', :foreign_key => :adjustment_id
|
10
|
+
has_many :adjustments, :class_name => 'Adjustment', :foreign_key => :adjustment_id
|
11
|
+
has_many :adjustment_invoices, :class_name => 'AdjustmentInvoice', :foreign_key => :adjustment_id
|
12
|
+
has_many :charges, :class_name => 'Charge', :foreign_key => :adjustment_id
|
13
|
+
has_many :xpsi_tax_errors, :class_name => 'XpsiTaxError', :foreign_key => :adjustment_id
|
14
|
+
has_many :xpsi_trt_revokes, :class_name => 'XpsiTrtRevoke', :foreign_key => :adjustment_id
|
15
|
+
has_many :invoices, :through => account_histories
|
16
|
+
has_many :accounts, :through => account_histories
|
17
|
+
has_many :payments, :through => account_histories
|
18
|
+
has_many :customer_queries, :through => adjustments
|
19
|
+
has_many :currencies, :through => adjustments
|
20
|
+
has_many :invoices, :through => adjustments
|
21
|
+
has_many :atlanta_operators, :through => adjustments
|
22
|
+
has_many :adjustment_types, :through => adjustments
|
23
|
+
has_many :adjustment_batches, :through => adjustments
|
24
|
+
has_many :invoices, :through => adjustment_invoices
|
25
|
+
has_many :accounts, :through => adjustment_invoices
|
26
|
+
has_many :receivable_types, :through => adjustment_invoices
|
27
|
+
has_many :subtotals, :through => charges
|
28
|
+
has_many :customer_nodes, :through => charges
|
29
|
+
has_many :invoices, :through => charges
|
30
|
+
has_many :accounts, :through => charges
|
31
|
+
has_many :currencies, :through => charges
|
32
|
+
has_many :tariffs, :through => charges
|
33
|
+
has_many :services, :through => charges
|
34
|
+
has_many :receivable_types, :through => charges
|
35
|
+
has_many :normalised_events, :through => charges
|
36
|
+
has_many :gl_codes, :through => charges
|
37
|
+
has_many :payments, :through => charges
|
38
|
+
has_many :charges, :through => charges
|
39
|
+
has_many :customer_nodes, :through => xpsi_tax_errors
|
40
|
+
has_many :xpsi_tax_errors, :through => xpsi_tax_errors
|
41
|
+
has_many :error_messages, :through => xpsi_tax_errors
|
42
|
+
has_many :services, :through => xpsi_tax_errors
|
43
|
+
has_many :normalised_events, :through => xpsi_tax_errors
|
44
|
+
validates_presence_of :adjustment_id
|
45
|
+
validates_numericality_of :adjustment_id, :allow_nil => false, :only_integer => true
|
46
|
+
validates_presence_of :last_modified
|
47
|
+
validates_presence_of :adjustment_nr
|
48
|
+
validates_length_of :adjustment_nr, :allow_nil => false, :maximum => 30
|
49
|
+
validates_numericality_of :adjustment_batch_id, :allow_nil => true, :only_integer => true
|
50
|
+
validates_presence_of :adjustment_type_id
|
51
|
+
validates_numericality_of :adjustment_type_id, :allow_nil => false, :only_integer => true
|
52
|
+
validates_presence_of :adjustment_status_code
|
53
|
+
validates_numericality_of :adjustment_status_code, :allow_nil => false, :only_integer => true
|
54
|
+
validates_presence_of :description
|
55
|
+
validates_length_of :description, :allow_nil => false, :maximum => 255
|
56
|
+
validates_numericality_of :from_account_id, :allow_nil => true, :only_integer => true
|
57
|
+
validates_numericality_of :from_gl_code_id, :allow_nil => true, :only_integer => true
|
58
|
+
validates_numericality_of :from_adjust_gl_code_id, :allow_nil => true, :only_integer => true
|
59
|
+
validates_presence_of :adjustment_text
|
60
|
+
validates_length_of :adjustment_text, :allow_nil => false, :maximum => 80
|
61
|
+
validates_presence_of :to_account_id
|
62
|
+
validates_numericality_of :to_account_id, :allow_nil => false, :only_integer => true
|
63
|
+
validates_numericality_of :to_gl_code_id, :allow_nil => true, :only_integer => true
|
64
|
+
validates_numericality_of :to_adjust_gl_code_id, :allow_nil => true, :only_integer => true
|
65
|
+
validates_presence_of :adjustment_invoice_code
|
66
|
+
validates_numericality_of :adjustment_invoice_code, :allow_nil => false, :only_integer => true
|
67
|
+
validates_numericality_of :invoice_id, :allow_nil => true, :only_integer => true
|
68
|
+
validates_presence_of :atlanta_operator_id
|
69
|
+
validates_numericality_of :atlanta_operator_id, :allow_nil => false, :only_integer => true
|
70
|
+
validates_presence_of :currency_id
|
71
|
+
validates_numericality_of :currency_id, :allow_nil => false, :only_integer => true
|
72
|
+
validates_presence_of :currency_conversion_date
|
73
|
+
validates_presence_of :amount
|
74
|
+
validates_numericality_of :amount, :allow_nil => false
|
75
|
+
validates_numericality_of :from_amount, :allow_nil => true
|
76
|
+
validates_numericality_of :from_adjust_amount, :allow_nil => true
|
77
|
+
validates_numericality_of :from_total_amount, :allow_nil => true
|
78
|
+
validates_presence_of :to_amount
|
79
|
+
validates_numericality_of :to_amount, :allow_nil => false
|
80
|
+
validates_presence_of :to_adjust_amount
|
81
|
+
validates_numericality_of :to_adjust_amount, :allow_nil => false
|
82
|
+
validates_presence_of :to_total_amount
|
83
|
+
validates_numericality_of :to_total_amount, :allow_nil => false
|
84
|
+
validates_presence_of :adjustment_date
|
85
|
+
validates_presence_of :adjustment_received_date
|
86
|
+
validates_numericality_of :customer_query_id, :allow_nil => true, :only_integer => true
|
87
|
+
validates_length_of :general_1, :allow_nil => true, :maximum => 255
|
88
|
+
validates_length_of :general_2, :allow_nil => true, :maximum => 255
|
89
|
+
validates_length_of :general_3, :allow_nil => true, :maximum => 255
|
90
|
+
validates_length_of :general_4, :allow_nil => true, :maximum => 255
|
91
|
+
validates_length_of :general_5, :allow_nil => true, :maximum => 255
|
92
|
+
validates_length_of :general_6, :allow_nil => true, :maximum => 255
|
93
|
+
validates_length_of :general_7, :allow_nil => true, :maximum => 255
|
94
|
+
validates_length_of :general_8, :allow_nil => true, :maximum => 255
|
95
|
+
validates_length_of :general_9, :allow_nil => true, :maximum => 255
|
96
|
+
validates_length_of :general_10, :allow_nil => true, :maximum => 255
|
97
|
+
end
|