Class: Usps::Support::Models::Hq::Squadrons::District
- Inherits:
-
Website
- Object
- ActiveRecord::Base
- Usps::Support::Models::Hq::SharedRecord
- BaseRecord
- Website
- Usps::Support::Models::Hq::Squadrons::District
- Defined in:
- lib/usps/support/models/hq/squadrons/district.rb
Overview
District organization information
Instance Method Summary collapse
-
#all_squadrons ⇒ Object
def name = “District ##number”.
-
#number ⇒ Object
def self.lookup(number) = where(“Name REGEXP ‘^D?0?##number$’”).first.
Methods inherited from Usps::Support::Models::Hq::SharedRecord
allow_hq_database_edits?, ignore_type_column_sti!
Instance Method Details
#all_squadrons ⇒ Object
def name = “District ##number”
43 |
# File 'lib/usps/support/models/hq/squadrons/district.rb', line 43 def all_squadrons = (squadrons + former_squadrons).sort_by(&:name) |
#number ⇒ Object
def self.lookup(number) = where(“Name REGEXP ‘^D?0?##number$’”).first
39 |
# File 'lib/usps/support/models/hq/squadrons/district.rb', line 39 def number = self.Name.sub(/^D/, '').to_i |