Class: FeideeUtils::AccountGroup

Inherits:
Record
  • Object
show all
Includes:
Mixins::ParentAndPath, Mixins::Type
Defined in:
lib/feidee_utils/account_group.rb

Constant Summary collapse

FieldMappings =
{
  name:                   "name",
  parent_poid:            "parentAccountGroupPOID",
  raw_path:               "path",
  depth:                  "depth",
  raw_type:               "type",
  ordered:                "ordered",
}.freeze
IgnoredFields =
[
  "userTradingEntityPOID", # Foreign key to t_user.
  "_tempIconName",         # Icon name in the app
  "clientID",              # Always equal to poid.
].freeze

Constants included from Mixins::ParentAndPath

Mixins::ParentAndPath::NullPOID

Constants included from Record::Utils

Record::Utils::AssumedTimezone

Instance Attribute Summary

Attributes included from Record::Namespaced::ClassMethods

#child_classes

Instance Method Summary collapse

Methods included from Mixins::Type

included, #type

Methods included from Mixins::ParentAndPath

#has_parent?, #parent, #path, #validate_depth_integrity, #validate_one_level_path_integrity, #validate_path_integrity_hard

Methods inherited from Record

generate_subclasses, #initialize, validate_global_integrity

Methods included from Record::Computed::ClassMethods

#computed

Methods included from Record::Persistent::ClassMethods

#all, #column_names, #columns, #find, #find_by_id

Methods included from Record::Accessors

#last_update_time, #poid

Constructor Details

This class inherits a constructor from FeideeUtils::Record

Instance Method Details

#to_sObject



42
43
44
# File 'lib/feidee_utils/account_group.rb', line 42

def to_s
  "#{name} (AccountGroup/#{poid})"
end

#validate_integrityObject



10
11
12
13
14
15
16
17
# File 'lib/feidee_utils/account_group.rb', line 10

def validate_integrity
  validate_depth_integrity
  validate_one_level_path_integrity

  unless (poid == 1 and raw_type == -1) or (raw_type >= 0 and raw_type <= 2)
    raise "Unexpected account group type #{raw_type}.\n" + inspect
  end
end